Hi, Im a total PHP Newbie, and I am looking to build a site for my friends. The homepage of the site requires you to enter a password ( the password is 'havealaugh' ) ,then sends the password to a PHP script to see if it is correct, and, regarding the result, redirect to another page. The only problem is, when i submit the password to the PHP script, a blank page is produced, and not the target page. This is the PHP verify script:
<?php
session_start();
function gotoURL($url) {
header("Location: " + $_SERVER['HTTP_HOST'] + $url);
}
function verifyPass($pwd) {
$correct = "d86fc0e3acdaa15b9f760fd3e2fa10d9";
$current = md5($pwd);
if($current == $correct)
{
$_SESSION["auth"] = true;
gotoURL("\welcome.php");
exit();
}
}
?>
And this is the target page script:
<?php
if(!isset($_SESSION["auth"]) || $_SESSION["auth"] != true)
{
die("Auth error! Bog Off!");
}
?>
<!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>Test</title>
</head>
<body>
Hello, This is a test!
</body>
</html>
Anybody have any ideas why this won't work?
Thanks
Ollie123