hi
I created a login script and originally was using php4.3.3 to write the script with. 
Then I found out that it had to be rewritten for php4.0.4pl1. I think when rewriting 
it for the older version it got messed up somehow and cant quite spot the 
error/problem in it. can anybody help here??

the query runs right for some reason (i.e. connection works) and query when echoed on 
the screen is right but for some reason the query comes back NULL?? even though there 
are valid users in the usertable?? 
here is the whole login script code: i have the actuall lines commented out and 
echo/print_r lines in place for debugging reasons:
[code]
<?php
session_start();
include("libs/conf.db");
//connection works since no errors are reported by mysql
mysql_connect($host, $mysqluser, $mysqlpwd)||die(mysql_error());
mysql_select_db($db);
$UserExists=mysql_query("select * from rnjresort_users where 
username='$_POST[username]' and pwd=md5($_POST[password])");
//$UserExists returns no valid resource id so something is 
//going wrong
 if($UserExists) {
$_SESSION['username']=$_POST['username'];
print_r($_SESSION);
print_r($_POST);
echo $UserExists;
//header("location: deletepost.php"); 
}
else {
print_r($_SESSION);//is empty of course
//following query echoes exactly the way i want it to so no 
//errors here that i can see
echo "select * from $UserTable where username='$_POST[username]' and 
pwd=md5($_POST[password])";
//header("location: login.html"); 
}
?>


tnx...

Reply via email to