Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi, trying to get this mailing list working for our band website. As I'm a poor musician, I've learned to do this myself but can't quite get it working.
As a user, when you submit your details it says 'thanks, you've been added to the list etc..', but I don't actually recieve an email telling me their details so I can add them to my list. I'm not using a database or anything just making my own list of the names.
When I first put it up it worked fine, but all of a sudden it just stopped, and I hadn't changed anything.
HELP PLEASE!
[b]THIS IS MY PHP[/b]Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>Official Homepage</title>
</head>
<body>
<?php
$potential_member_name = $_POST['name'];
$potential_member_email = $_POST['email'];
$email_subject = 'New mailing list subscriber';
$email_body = 'this fellow or perhaps fine young lady wants to hear more from us';
$email_body .= "name is $potential_member_name";
$email_body .= "email is $potential_member_email";
$from_name = 'Winters Web Lord';
$from_email = 'webmaster@example.com';
$headers = "from: $from_name <$from_email>\r\n";
$headers .= "reply-to: $from_name <$from_email>\r\n";
$headers .= "return-path: $from_name <$from_email>\r\n";
$headers .= "content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "x-priority: 1\r\n";
$headers .= "x-msmail-priority: normal\r\n";
$headers .= "x-mailer: php\r\n";
$to_email = 'mail@example.com';
mail($to_email, $email_subject, $email_body, $headers);
echo "<p>Thankyou $potential_member_name, your email address
($potential_member_email) has been added to our list. You shall hear from us
soon!</p>";
?>
</body>
</html>Code: Select all
<div id="form">
<img src="joinmail.jpg" alt="Join the mailing list!"/>
<form action="thanks.php" method="post" >
<p>Name : <input type="text" name="name" size='30' value='' maxlength='60'/></p>
<p>Email : <input type="text" name="email" size='30' value='' maxlength='60'/></p>
<p><input type="submit" value="submit" name="submit"/></p>
</form>
</div>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]