OK I got the code sorted. I know what the problem is I have got too many "<?" I am getting a bit confused.
<?php
extract($_POST);
//Extracts values using the post method
setcookie("accountref",$accountref,time()+1200);
setcookie("pin",$pin,time()+1200);
//Set cookie values for 1200 seconds
?>
<html>
<head>
<title>Welcome</title>
</head>
<body>
<?php
//Connect to database
$location = "localhost";
$username = "root";
$password = "";
$database = "onlinetax";
$conn=@mysql_connect("$location","$username","$password");
if (!$conn) die ("Error: Could not connect to database server.");
@mysql_select_db($database,$conn) or die ("Error: Could not open database.");
extract($_POST);
//Check if fields passed from the login screen are valid
//If not then they are redirected to the login screen
if (isset($accountref) && isset($pin) && $accountref != "" && $pin != "")
{
$query = "SELECT * FROM user WHERE username = '$accountref' AND password = '$pin'";
$result = mysql_query($query);
if ($row = @mysql_fetch_array($result))
{
{<?
<h1>Welcome you are logged In Proceed to the Personal Details Page</h1>
<a href="testing.php"></a>
<form method="post" action="testing.php" target="_self">
<p>
<input type="submit" value="Continue"/>
</p>
</form>
?>
}
else
//If not sucessful redirect back to login screen
{ <?
<h1>Incorrect Login Details</h1>
<form method="post" action="login.php" target="_self">
<p>
<input type="submit" value="Re-try?"/>
</p>
</form>
?>
}
//Close connection to server
@$disconn=mysql_close($conn);
if (!$disconn) die ("Error: Unable to disconnect from database server.");
</body>
</html>
Should I add or delete one?
It says my error is on line 33 which is:
{<?
<h1>Welcome you are logged In Proceed to the Personal Details Page</h1>
I know it is the opening <? bracket that is the problem I just dont know what to do about it, if that makes sense!!??