Question about tutorial user authentication with Mysql
Posted: Sun Dec 28, 2003 3:47 am
hi i was very interested in the code example of the tutorialon user authentication with mysql since i would like to create a portal application for my web sitehere is the code it always dies at the third line and says can't do it
<?
if($submit){
$db=mysql_connect("xxxxxx","xxxxxx","xxxxxx") or die ("cant connect");
mysql_select_db("techunit",$db) or die("cant change");
$result=mysql_query("SELECT * FROM user WHERE name='$username'",$db) or die ("cant do it");
while($row=mysql_fetch_array($result)){
if($row["password"]==$password){
printf("Successfully Logged IN!<a href='indexhigh.asp'>Enter</a>");
}
}
}
?>
any help would be appreciated thanks
<?
if($submit){
$db=mysql_connect("xxxxxx","xxxxxx","xxxxxx") or die ("cant connect");
mysql_select_db("techunit",$db) or die("cant change");
$result=mysql_query("SELECT * FROM user WHERE name='$username'",$db) or die ("cant do it");
while($row=mysql_fetch_array($result)){
if($row["password"]==$password){
printf("Successfully Logged IN!<a href='indexhigh.asp'>Enter</a>");
}
}
}
?>
any help would be appreciated thanks