%-) EXTREME NEWBIE ALERT %-)
This is the error i get:
Parse error: parse error, unexpected T_IF in /var/ on line 16
I have done alot of VB in the past. So i figured i would try some php and get into the web stuff. But, i have ran into a problem. I searched on the internet and all i could find was that i was using a reserved word (if). I have looked high and low. I am using this code from a book, then i can pick it apart and figure out what it is doing. I know thats kinda cheating, but hey, it works for me!!
Heres my Code:
<?
$username = "cust";
$hostnmae = "localhost";
$theconnection = mysql_connect($hostname, $username);
print "connected to mysql<br>";
$mydatabase=mysql_select_db("milligans",$theconnection);
$result_ar=mysql_fetch_array(mysql_query("select count (*) as numfound from username where user='{$HTTP_POST_VARS['user']}' and pass='{$http_POST_VARS['pass']}'"
if ($result_ar['numfound'] = 0) {
print "login failed unknown user";
}
else {
print "login succeded";
}
?>
Thanks for the help!!![[wavey3] [wavey3] [wavey3]](/data/assets/smilies/wavey3.gif)
This is the error i get:
Parse error: parse error, unexpected T_IF in /var/ on line 16
I have done alot of VB in the past. So i figured i would try some php and get into the web stuff. But, i have ran into a problem. I searched on the internet and all i could find was that i was using a reserved word (if). I have looked high and low. I am using this code from a book, then i can pick it apart and figure out what it is doing. I know thats kinda cheating, but hey, it works for me!!
Heres my Code:
<?
$username = "cust";
$hostnmae = "localhost";
$theconnection = mysql_connect($hostname, $username);
print "connected to mysql<br>";
$mydatabase=mysql_select_db("milligans",$theconnection);
$result_ar=mysql_fetch_array(mysql_query("select count (*) as numfound from username where user='{$HTTP_POST_VARS['user']}' and pass='{$http_POST_VARS['pass']}'"
if ($result_ar['numfound'] = 0) {
print "login failed unknown user";
}
else {
print "login succeded";
}
?>
Thanks for the help!!
![[wavey3] [wavey3] [wavey3]](/data/assets/smilies/wavey3.gif)