bentzak
Senior Member
As you may have noticed from the amount of postsi have put up recently, im building my first website, and am learning! well, i have another question if anyone fancies helping me some more,
this is the code for my email form, it all looks ok, syle wise on my page, but when i try and use it on my test server it doesnt really work. after i click submit it goes to a new page that says "no subject" and "click here" which takes you back, two things, why does it say no subject? is it not sending? and also how do i get it so that it displays any messages on the same page??
here is the code contact page php,
think thats all the code?
Cheers, in advance!
Zak
this is the code for my email form, it all looks ok, syle wise on my page, but when i try and use it on my test server it doesnt really work. after i click submit it goes to a new page that says "no subject" and "click here" which takes you back, two things, why does it say no subject? is it not sending? and also how do i get it so that it displays any messages on the same page??
here is the code contact page php,
PHP:
<?php
if($content)
{
$from = $_POST["from"];
$email = $_POST["email"];
$content = "This message is from $from whose email address is $email.\r\n-----------\r\n ";
$content = $content . $_POST["content"];
$content = wordwrap($content, 70);
mail('[email protected]', 'website inquiry', $content);
echo "Your message has been sent, and I will reply within 48hrs. Thank you.";
}
?>
<form method="post" action="mail.php">
<p>Name:</p>
<p>
<input type="text" name="from" title="Your name">
</p>
<p>Email:</p>
<p>
<input type="text" name="email">
</p>
<p>Message:</p>
<p>
<textarea name="content" cols="50" rows="20"></textarea>
</p>
<p><?php require_once('recaptchalib.php');
$publickey = "...";
echo recaptcha_get_html($publickey);
?></p>
<p><input type="submit" value="Submit"></p>
</form>
Cheers, in advance!
Zak