Page 1 of 1

[Solved] Can't find this parse error

Posted: Sun Jun 19, 2005 11:06 am
by bouboule
Hey, parse error is line 28 (it is marked in the following code). Either IM blind or this isn't a evident one. Thanks

Code: Select all

<?php
include("auth.php");
include("get_users.php");

$usern=$_POST['usern'];
$passw=$_POST['passw'];
$userfound="false";
$goodpass="false";

echo "Username= " . $usern . "<br>";
echo "Password= " . $passw . "<br>" . "<br>";

$fp = fopen("users.txt", "r");
$data = fread($fp, filesize("users.txt"));

$brake = explode("\n",$data);

foreach($brake as $values){

echo $values . "<br>";
$temp = explode("|",$values);

    foreach($temp as $value){
      echo $value . "<br>";
    }
//==========
if ($temp[0]==$usern){
    if (temp[1]==$passw){ // THIS IS LINE 28
        $userfound = "true";
        $goodpass = "true";
        break;
    }else{
        $userfound = "true";
        $goodpass = "false";
        break;
    }
}else{
    $userfound = "false";
    $goodpass = "false";
}

//===============

}// end foreach

if ($userfound=="true"){
  echo "User found!!!" . "<br>";
}else{
  echo "User not Found!!!" . "<br>";
}

if ($goodpass=="true"){
  echo "Password Good!!!" . "<br>";
}else{
  echo "Password Wrong!!!" . "<br>";
}

?>
If I take the code between the ======= out, everything works but when I put it in everything doesnt work. Its because of this parse error im getting on line 28. I can't seem to find the problem (I think Im blind) Thank you in advance.

Posted: Sun Jun 19, 2005 11:07 am
by bouboule
Never mind IM blind... Forgot the $ infront of $temp[1] lol... thanks anyways