P
Pourya J
Guest
Dear friend
I have used the exact method on http://www.tutvid.com/tutorials/dreamweaver/tutorials/phpFormHandler.php
to create my php form processor script but It doesn’t work. I have my html and php tags here:
1- My form in html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<form id="form1" name="form1" method="post" action="http://www.toolsandtutorials.com/form/form.php"
<table width="100%" border="0" cellpadding="6">
<tr>
<td><div align="right">
<label for="email">Email:</label>
</div></td>
<td><div align="left">
<input name="email" type="text" id="email" size="35" maxlength="90" />
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="name">Name:</label>
</div></td>
<td><div align="left">
<input name="name" type="text" id="name" size="35" maxlength="80" />
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="phone">Phone:</label>
</div></td>
<td><div align="left">
<input name="phone" type="text" id="phone" size="35" maxlength="12" />
</div></td>
</tr>
<tr>
<td><div align="right">Budget:</div></td>
<td><div align="left">
<p>
<label>
<input type="radio" name="budget" value="less than 1000" id="budget_0" />
Less than $1,000</label>
<label>
<input type="radio" name="budget" value="1000- 2500" id="budget_1" />
$1,000- $2,500</label>
<label>
<input type="radio" name="budget" value="2500- 5000" id="budget_2" />
$2,500- $5,000</label>
<label>
<input type="radio" name="budget" value="5000- 10000" id="budget_3" />
$5,000- $10,000</label>
<label>
<input type="radio" name="budget" value="10000+" id="budget_4" />
$10,000 +</label>
</p>
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="travelers">Number of Travelers:</label>
</div></td>
<td><div align="left">
<select name="travelers" id="travelers">
<option>Choose...</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="10+">10+</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="comments">Comments:</label>
</div></td>
<td><div align="left">
<textarea name="comments" id="comments" cols="26" rows="5"></textarea>
</div></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><div align="left">
<input type="checkbox" name="newsletter" id="newsletter" />
<label for="newsletter"> Subscribe to Our FREE Online Newsletter!</label>
</div></td>
</tr>
<tr>
<td><div align="right">
<input type="reset" name="Reset" id="button" value="Reset Form!" />
</div></td>
<td><div align="left">
<label for="submit"></label>
<input type="submit" name="submit" id="submit" value="Send Email!" />
</div></td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>
My php codes:
<?php
/* Subject and Email Variables */
$emailSubject = ' Crazy PHP Scripting! ' ;
$webMaster = ' [email protected] ' ;
/* Gathering Data Variables */
$emailField = $_POST ['email'] ;
$nameField = $_POST ['name'] ;
$phoneField = $_POST ['phone'] ;
$budgetField = $_POST ['budget'] ;
$travelersField = $_POST ['travelers'] ;
$commentsField = $_POST ['comments'] ;
$newsletterField = $_POST ['newsletter'] ;
$body = <<<EOD
print "Email: $email
Name: $name
Phone Number: $phone
Budget: $budget
Number of Travelers: $travelers
Comments: $comments
Newsletter: $newsletter
EOD;
$headres = "Form: $email\r\n";
$headres .= "content-type: text/html\r\n";
$success = mail($webmaster, $emailsubject, $body, $headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
thank you very much
</body>
</html>
EOD;
echo "$theresults";
?>
my form is uploaded on:
http://toolsandtutorials.com/form/form.html
this script doesn't send emails. Please help
I have used the exact method on http://www.tutvid.com/tutorials/dreamweaver/tutorials/phpFormHandler.php
to create my php form processor script but It doesn’t work. I have my html and php tags here:
1- My form in html:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<form id="form1" name="form1" method="post" action="http://www.toolsandtutorials.com/form/form.php"
<table width="100%" border="0" cellpadding="6">
<tr>
<td><div align="right">
<label for="email">Email:</label>
</div></td>
<td><div align="left">
<input name="email" type="text" id="email" size="35" maxlength="90" />
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="name">Name:</label>
</div></td>
<td><div align="left">
<input name="name" type="text" id="name" size="35" maxlength="80" />
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="phone">Phone:</label>
</div></td>
<td><div align="left">
<input name="phone" type="text" id="phone" size="35" maxlength="12" />
</div></td>
</tr>
<tr>
<td><div align="right">Budget:</div></td>
<td><div align="left">
<p>
<label>
<input type="radio" name="budget" value="less than 1000" id="budget_0" />
Less than $1,000</label>
<label>
<input type="radio" name="budget" value="1000- 2500" id="budget_1" />
$1,000- $2,500</label>
<label>
<input type="radio" name="budget" value="2500- 5000" id="budget_2" />
$2,500- $5,000</label>
<label>
<input type="radio" name="budget" value="5000- 10000" id="budget_3" />
$5,000- $10,000</label>
<label>
<input type="radio" name="budget" value="10000+" id="budget_4" />
$10,000 +</label>
</p>
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="travelers">Number of Travelers:</label>
</div></td>
<td><div align="left">
<select name="travelers" id="travelers">
<option>Choose...</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="10+">10+</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="comments">Comments:</label>
</div></td>
<td><div align="left">
<textarea name="comments" id="comments" cols="26" rows="5"></textarea>
</div></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><div align="left">
<input type="checkbox" name="newsletter" id="newsletter" />
<label for="newsletter"> Subscribe to Our FREE Online Newsletter!</label>
</div></td>
</tr>
<tr>
<td><div align="right">
<input type="reset" name="Reset" id="button" value="Reset Form!" />
</div></td>
<td><div align="left">
<label for="submit"></label>
<input type="submit" name="submit" id="submit" value="Send Email!" />
</div></td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>
My php codes:
<?php
/* Subject and Email Variables */
$emailSubject = ' Crazy PHP Scripting! ' ;
$webMaster = ' [email protected] ' ;
/* Gathering Data Variables */
$emailField = $_POST ['email'] ;
$nameField = $_POST ['name'] ;
$phoneField = $_POST ['phone'] ;
$budgetField = $_POST ['budget'] ;
$travelersField = $_POST ['travelers'] ;
$commentsField = $_POST ['comments'] ;
$newsletterField = $_POST ['newsletter'] ;
$body = <<<EOD
print "Email: $email
Name: $name
Phone Number: $phone
Budget: $budget
Number of Travelers: $travelers
Comments: $comments
Newsletter: $newsletter
EOD;
$headres = "Form: $email\r\n";
$headres .= "content-type: text/html\r\n";
$success = mail($webmaster, $emailsubject, $body, $headers);
/* Results rendered as HTML */
$theResults = <<<EOD
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
thank you very much
</body>
</html>
EOD;
echo "$theresults";
?>
my form is uploaded on:
http://toolsandtutorials.com/form/form.html
this script doesn't send emails. Please help