My simple PHP is outputting wrong things.
Posted
by Sergio Tapia
on Stack Overflow
See other posts from Stack Overflow
or by Sergio Tapia
Published on 2010-06-01T21:46:43Z
Indexed on
2010/06/01
21:53 UTC
Read the original article
Hit count: 524
EDIT: I forgot to add semi colons. Now there is another problems. I'm getting a error:
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\useraccess.php on line 12
It outputs:
0){ echo 'si'; } ?>
When it should only output 'si' in the body.
Here's the code:
<html>
<head>
</head>
<body>
<?
$user = mysql_real_escape_string($_GET["u"])
$pass = mysql_real_escape_string($_GET["p"])
$query = "SELECT * FROM usario WHERE username = '$user' AND password = '$pass'"
mysql_connect(localhost, "sergio", "123");
@mysql_select_db("multas") or die( "Unable to select database");
$result=mysql_query($query);
if(mysql_numrows($result) > 0){
echo 'si';
}
?>
</body>
</html>
© Stack Overflow or respective owner