Need HELP with contact and mailing list forms FAST!!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
likegluelikecrew
Forum Newbie
Posts: 1
Joined: Mon Jan 18, 2010 9:22 pm

Need HELP with contact and mailing list forms FAST!!!!!

Post by likegluelikecrew »

My Mailing List form doesn't work, I got this error...

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/content/s/w/e/sweb09/html/mailinglist.php on line 8

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/content/s/w/e/sweb09/html/mailinglist.php on line 9

Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/content/s/w/e/sweb09/html/mailinglist.php on line 9

Here's the code I used for the mailing list form...

<form method="post" action="http://www.sdesignsstore.com/mailinglist.php">
<input name="message" type="text" value="Enter email address" />
<input type="submit" value="send" />
</form>

I uploaded the php file in the root directory of the site, here's the code for mailinglist.php...

<?
$to="xporcellx@gmail.com";
$subject="Contact From Your Website";
$message=$_REQUEST[message];
mail($to,$subject,$message);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Message Sent</title>
</head>
<body>
Thank you... Your message has been sent.
</body>
</html>

What am I doing wrong? Thanks!
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Re: Need HELP with contact and mailing list forms FAST!!!!!

Post by infolock »

i don't think that's all your code for mailinglist.php.

either way, try prining out the results of your $_POST array. Dunno why you're using $_REQUEST. I realize it can be both, but your form is a POST form, so not sure what you're trying to achieve. Anyways, I'd check your Message data. you're propbably passing some characters that need to be sanitzed before you can send the email.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

Take a careful look at lines 8 and nine. If you can't see a problem, post them here.
Post Reply