Forum Home
Press F1
 
Thread ID: 113376 2010-10-17 01:13:00 PHP problem GreacherTech (15784) Press F1
Post ID Timestamp Content User
1145530 2010-10-17 01:13:00 Hey guys anyone an expert on PHP? If so could ya tell me why this simple contact form isn't working? here's the code for it

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org
<html xmlns="www.w3.org
<head>
<title>Contact Us</title>
</head>

<body>
<h1>Contact Us</h1>
<table border="0">
<tr>
<td width="131"><p align="right">Your Name</p></td>
<td width="59"><input name="name" type="text" id="name" size="50" /></td>
</tr>
<tr>
<td><p align="right">Email Address</p></td>
<td><input name="email" type="text" id="email" size="50" /></td>
</tr>
<tr>
<td><p align="right">Message</p></td>
<td><textarea name="message" id="message" cols="45" rows="5"></textarea></td>
</tr>
</table>
<p>
<input type="submit" name="button" id="button" value="Send Message" />
</p>
<p>&nbsp;</p>
</body>
</html>

Thanks in advanced
GT
GreacherTech (15784)
1145531 2010-10-17 01:20:00 You need to have a


<form method="post" action="[valid argument]">

and a closing /form tag wrapped around the whole thing

See here (www.phpf1.com). :)
SoniKalien (792)
1145532 2010-10-17 01:22:00 Hi Soni, could you please show me where it needs to go, i'm fairly noob with PHP so if you could just show me that would be great GreacherTech (15784)
1145533 2010-10-17 01:25:00 Have a look at the tutorial I linked to :) SoniKalien (792)
1145534 2010-10-17 01:37:00 Hey guys anyone an expert on PHP? If so could ya tell me why this simple contact form isn't working? here's the code for it...SoniKalien is right about the need for <form> tags - unless you add those, you won't get anywhere ;).

If you still have problems, you may also want to post the rest of the code - your thread title mentions you're using PHP to process this, but you haven't actually posted any PHP code - all you've posted is the HTML describing your input fields and page structure.

Edit: One note about the tutorial SoniKalien linked to - don't use eregi (He's making a point about unskilled people who claim technical expertise.) as the tutorial recommends; it's deprecated and shouldn't be used. Use preg_match (He's making a point about unskilled people who claim technical expertise.) with the 'i' flag instead.
Erayd (23)
1