Hello,
I'm trying to set up a little puzzle where if someone solves the puzzle a password is displayed in an image. They must then type that password into a text input box to move on to the next page. On page challenge1.php I have the following code:
<form name="nextchallenge" method="post" action="challenge2.php">
Password for next Challenge: <input type="text" name="password">
<input type="submit" value="Submit!" name="submitted">
</form>
On page challenge2.php I have the following code before the <html> tag:
<?php
function CheckLogin($pw)
{
$valid=false;
$f = fopen("password1.txt","r");
$line = fgets($f);
if ($line = $pw)
$valid=true;
}
if($valid=true)
return=true;
else
return=false;
?>
<?php
if(!CheckLogin($_POST=['password']))
echo "Error";
else
header('Location: challenge2.php');
?>
I'm getting an unexpected '=' on line 10 type of error. Any help would be appreciated!