I am a newbie PHP programmer (Learning stage) and trying to add a simple PHP contact us form to my site
It is processing the form but sending me a email with no information on it, somehow it is failing to collect data from the textboxes. Please see codes below:
HTML CODE
<h2>Contact Us</h2>
<br>
<Center>
<p>
<B>Thanks for spending time on our site your comments/suggestions will help us improve!
<br>
Please fill in all the details
</B>
</p>
<form method=post action=email_form.php>
<Table border=0 cellspacing=0 cellpadding=0 class=small_txt>
<TR><TD width=150><font class=small_txt><B>Your Name: </B></font></TD>
<TD><input type=text class=small_txt name=user_name size=50></TD></TR>
<TR><TD width=150><font class=small_txt><B>Your Email address: </B></font></TD>
<TD><input type=text class=small_txt name=email_address size=50></TD></TR>
<TR><TD width=150><font class=small_txt><B>Comments Suggestions: </B></font></TD>
<TD><TEXTAREA rows=5 cols=49 name=email_message class=small_txt></TEXTAREA></TD></TR>
</Table>
<P></P>
<input type=submit value="Submit Info" class=small_txt>
</form>
</center>
PHP CODE
<?php
$email_msg_to = "accounts@fashion-basement.com";
//change to a proper email address where the message should go to
/*
All these other feilds values $user_name, $email_message, $email_address are retrived from email_form.htm that we have created earlier!
*/
$message = "Comments/Suggestions \n\nName: ". $user_name ."\nEmail: ". $email_address ."\n\nMessage: ". $email_message;
mail($email_msg_to, "Msg From: " . $user_name ." Comments/Suggestions", $message, "From: ". $email_msg_to);
echo "Thanks for your comments/suggestions <B>". $user_name . "</B> we have recieved your message and will contact you soon.";
?>
Here's the link: http://fashion-basement.com/email_showform.php
Please help!!!!
Thank you
[ ModEdit - bpat1434 ] Please use the HTML and PHP tags on this forum.