Flex PHP Login System Not Working Correctly -
i wrote login system using flex , php, odd reason php echos both "true" , "false". ideas why happening?
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; //include("connect.php"); // used connection database. $username = strip_tags($_post['username']); $password = strip_tags($_post['password']); // temp username , password until hooked database. $strdetails[0] = "dennis"; $strdetails[1] = "test"; // database work here (grab user) /*<!-- $query = "select username,password users username='$username' , password='$password'"; while ($row = mysql_fetch_array($query)) { // have not tested yet. if ($row['username'] == $username && $row['password'] == md5($password)) // if don't want encryption take off md5 echo "<login>true</login>"; else echo "<login>false</login>"; }--> */ // temp until hooked database. if ($username == $strdetails[0] && $password == $strdetails[1]) echo "<login>true</login>"; else echo "<login>false</login>";
?>
i had similar problem several months ago. reason 1 of loops wasn't parsing correctly.
can try changing temp login validation to:
// temp until hooked database. if (($username == $strdetails[0]) && ($password == $strdetails[1])) { echo "<login>true</login>"; } else { echo "<login>false</login>"; }
let me know how on, if doesn't fix i'll dig old troublesome script.
Comments
Post a Comment