Jump to content


contact form


6 replies to this topic

#1 .Addict

    Young Padawan

  • Members
  • Pip
  • 8 posts

Posted 03 January 2006 - 06:45 PM

i have a php contact form on my site, but when i test it i never get the email, heres my codes.


html form
<form method="post" action="mail.php">
				<span style="font-family: Arial, Helvetica, sans-serif; font-size: 11px"><span class="style2">|</span>Name:</span> 
				<input type="text" name="name"><br>
				<span style="font-family: Arial, Helvetica, sans-serif; font-size: 11px"><span class="style2">|</span>Email :</span> 
				<input type="text" name="email"><br>
				<span style="font-family: Arial, Helvetica, sans-serif; font-size: 11px"><span class="style2">|</span>Message:</span><br> 
				<span class="style2">|</span>
				<textarea cols="40" rows="7" name="message"></textarea>

<br>
<input type="submit" value="Send">&nbsp;<input type="reset" value="clear">
</form>


mail.php
<?
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$message = $_REQUEST['message'];

if (!isset($_REQUEST['email'])) {
header( "Location: index.php" );
}

elseif (empty($email) || empty($message)) {
header( "Location: error.php" );
}
else {

mail( "addictskickyourass@gmail.com", "Portfolio Contact",
"Name: $name\n\nMessage: $message",
"From: $email" );

header( "Location: thanks.php" );
}
?>


#2 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 03 January 2006 - 07:26 PM

Try puting $_POST instead of $_REQUEST

dEcade

#3 .Addict

    Young Padawan

  • Members
  • Pip
  • 8 posts

Posted 03 January 2006 - 08:07 PM

didnt work ;)

#4 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 03 January 2006 - 08:24 PM

Since that looks basically write, i'd recommend asking your host whether or not you're even allowed to send mail from your site.
If you are, then i'd take a look at the following link and see if you can find anything.
http://php.net/manual/en/ref.mail.php

#5 Indigo

    Official Alien

  • Members
  • PipPipPip
  • 617 posts
  • Gender:Male
  • Location:Trondheim, Norway
  • Interests:Computing in general, especially design and programming of all kinds.

Posted 04 January 2006 - 01:47 AM

...Or you can check out a few tutorials in the tutorial-section of this forum. I´ve added a tutorial there myself.

#6 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 04 January 2006 - 05:25 AM

well that wont help much if your cant sent mail.

#7 .Addict

    Young Padawan

  • Members
  • Pip
  • 8 posts

Posted 04 January 2006 - 09:34 PM

Made it work, i talked with the host, they told me something but i forgot, works now thanks





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users