no i am still getting blank page so here is the whole page script
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lost and Found Registration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
$correctAnswer = 4;
if (isset($_POST['leg']) && $_POST['leg'] != $correctAnswer)
{
// send em away
header("Location: http://www.lostpetsplymouth.com/error-page.html");
exit();
}
//This gets all the other information from the form
$state=$_POST['state'];
$type=$_POST['type'];
$area=$_POST['area'];
$desc=$_POST['desc'];
$name=$_POST['name'];
$email=$_POST['email'];
$tel=$_POST['tel'];
$pnum=$_POST['pnum'];
$date = date("d-m-Y");
$pname=$pnum.".jpg";
if ((($_FILES["pic"]["type"] == "image/gif")
|| ($_FILES["pic"]["type"] == "image/jpeg")
|| ($_FILES["pic"]["type"] == "image/pjpeg"))
&& ($_FILES["pic"]["size"] < 20000))
{
if ($_FILES["pic"]["error"] > 0)
{
echo "Return Code: " . $_FILES["pic"]["error"] . "<br />";
}
else
move_uploaded_file($_FILES['pic']['tmp_name'], 'uploads/'.$pname);
}
}
else
{
echo "Invalid file";
}
// Connects to your Database
$dbh=mysql_connect("localhost", "vcd", "57") or die('I cannot connect to database because: ' .mysql_error()) ;
mysql_select_db("pets");
//Writes the information to the database
mysql_query("INSERT INTO `register` VALUES ('$id', '$state', '$type', '$area', '$desc', '$name', '$email', '$tel', '$pname', '$date')");
//compose the mail message
$msg= "New Record\n Region: $region, Name: $name, Email: $email ";
//send the mail
mail('d@gmail.com','New Record',$msg)
?>
<?php
echo "your information has been added to the directory You will be redirected in three seconds!><br /><br />
<div class='info'>If you don't wish to wait, <a href='index.html'>click here</a>";
echo'<meta http-equiv="REFRESH" content="2;url=index.html">';
?>
</body>
</html>
Bookmarks