Forum Moderators: coopster
Parse error: parse error, unexpected '\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/youth22/public_html/testing/authtest.php on line 14
that line is
$sql = "SELECT * FROM $utable WHERE username='$_POST["Username"]' and user_password='" . md5 ($_POST["Password"]) . "'";
any help would be great. I was under the impression (from what i've read, that $_POST["input name"] would supply the information from that input (on a form) but sql or something doesn't seem to like that.
$sql = "SELECT * FROM $utable WHERE username='$_POST[\"Username\"]' and user_password='" . md5 ($_POST["Password"]) . "'";
To be honest even though this might fix the error you probably want it be:
$sql = "SELECT * FROM $utable WHERE username='" .$_POST["Username"]. "' and user_password='" . md5 ($_POST["Password"]) . "'";
This will make sure the variables are correctly inserted into the string.
[edit: re-phrased to clarify]
$sql = "SELECT * FROM $utable WHERE username='" . $_POST['Username'] . "' AND user_password = '" . md5($_POST['Password']) . "'";
[edited by: coopster at 9:27 pm (utc) on July 9, 2004]
.htaccess? If so, and you are going to a full-blown user-defined authentication system by means of a database, you won't need the
.htaccessfile (once your login code is working effectively). I don't follow what you mean by the "ugly box"...?
Codes working fine now, one more question (for now anyway):
$num = mysql_num_rows($result);
if ($num!= "0") {
header("Location: /gallery");
exit; } else { header("Location: /testing");
}
?>
is it possible to make these links open in a frame?
edit is my friend: if thats possible, is it possible to open two links in two seperate frames (I know it can be done with javascript, but javascript doesn't like being in my php)