View Full Version : email form php


Brandon
07-08-2003, 05:49 PM
<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$name = $_REQUEST['name'] ;

mail( "thejagxj220@hotmail.com", "Email Form",
$message, "From: $name <$email>" );
header( "Location: thankyou.html" );
?>


that file is called emailform.php
on a html page i wanna make a form that makes that work.

pb&j
07-08-2003, 06:10 PM
try this...

<html>
<head>
<title> My Test Form </title>
</head>
<body>
Send us an comment about our site!<br />
<form action="emailform.php" method="post">
Your Name : <input type="text" name="name"><br />
Your email : <input type="text" name="email"><br />
Your Message : <textarea name="message" rows="3" cols="40"></textarea>
</form>
</body>
</html>

Brandon
07-08-2003, 09:27 PM
thanks but dont i need a submit button also? its not seeming to work and jordans the one who first gave me the sendmail.php and the html code but his comps broke or somethin so i cant ask him yet.

pb&j
07-09-2003, 06:57 AM
oops, yup. kinda forgot the submit button there.

add this just before the </form> tag...

<input type="submit" value="Send the info">
<input type="reset" value="Clear the form">

pb&j
07-09-2003, 05:01 PM
if that does not work, i think the method may have to be GET instead of POST.

Brandon
07-10-2003, 02:46 PM
lol yea its method=get and the php file was called sendmail.php which might of helped a lil bit ;)