garrensilverwing
New Member
- Messages
- 148
- Reaction score
- 0
- Points
- 0
After reading a few tutorials I wanted to give PHP a try. I want to write a php code that will verify the contents of a form submited (http://www.brianwallchess.x10hosting.com/advertise.htm)
and then mail them to me at my email address. I do not want the form emailed to me if it is not valid however here is the code that I have already but all I get is a blank page when I run it.
and then mail them to me at my email address. I do not want the form emailed to me if it is not valid however here is the code that I have already but all I get is a blank page when I run it.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Advertising Application Validation</title>
</head>
<body>
<p style="color: red;">
<?php
$firstname = $_REQUEST['firstname'] ;
$lastname = $_REQUEST['lastname'] ;
$email = $_REQUEST['email'] ;
$emailchk = $_REQUEST['verifyemail'] ;
$business = $_REQUEST['business'] ;
$text = $_REQUEST['text'] ;
$graphic = $_REQUEST['graphic'] ;
$yes = $_REQUEST['yes'] ;
$no = $_REQUEST['no'] ;
$dlink = $_REQUEST['dlink'] ;
$impress = $_REQUEST['impress'] ;
if ($firstname == "")
{echo("Please enter your first name.");}
if ($lastname == "")
{echo ("Please enter your last name.");}
if ($email == "")
{echo ("Please enter your email address.");}
if ($isValid == "false")
{echo ("The email address you have entered is not valid.");}
if ($email ==! $emailchk)
{echo ("The email addresses you have entered do not match.");}
if ($business == "")
{echo ("Please enter the name of your business or website.");}
if ($yes == "0")
{echo ("Only authorized people may submit this application.");}
else{
mail( "garrensilverwing@yahoo.com", "$business Advertising Application",
"Name: $firstname $lastname Email: $email Website or Business: $business Authorized: $yes $no Text: $text Graphic: $graphic Type: $dlink $impress", "From: $email" );
echo ("Thank you for submitting your application");}
?>
</p>
</body>
</html>
Last edited: