Hi. I am having a problem with PHP. I got these lines of code:

<?php

include('Include Stuff')

?>


<html>

<center>
<h1>Admin Login.</h1>

<form action="(Action Script)" method="POST">

Admin Name: <input type="text" name="name" /><br />
Password: <input type="password" name="code" /><br />
<input type="submit" value="Login" />

</form>
</html>

And this: (the action script in the above example)

<?php

$user = "UserName";
$pass = "Password";

$usrinput = $_REQUEST['name'];
$psinput = $_REQUEST['code'];

if ($usrinput == $user && $psinput == $pass) {

session_register("auth");
header( 'Location: http://www.mysite.com/page.php' );

} else {

echo "Incorrect input.";
}

?>

And this:

<?php
session_start()

if (!session_is_registered("auth")) { // Line I'm having an error

// Send that invader back home. Nothing for that person to see here.
header( 'Location: http://www.mysite.com' );
}



?>

I am having a problem with line 4 in the above code. Here's the error:

Parse error: syntax error, unexpected T_IF in (folder name here) on line 4

When I don't get this error, it redirects me back to the link I want even though the session "auth" is registered.

Thank you if you help me.

sir, you may try this:

if (!isset($_SESSION['auth'])) {

header( 'Location: http://www.mysite.com' );

}

What is include('Include Stuff')? you should list it properly like

include('./verify.php');

You're getting the parse error because you forgot a semicolon on line 2. Whenever you get "Unexpected blabla" at the beginning of a line, there's a good chance that you forgot a semicolon on the line before.