affordit Posted March 16, 2008 Share Posted March 16, 2008 Session setting everything but username and password can anyone see what wrong please!!! <?php // this starts the session session_start(); include("sharons_dbinfo.inc.php"); mysql_connect(mysql,$name,$password); mysql_select_db($database) or die( "Unable to select database"); $query = "Select id, username, email, phone, end_date, valid, premium from login Where username = '$username' and psword = '$psword' AND valid='1'"; $results = mysql_query($query) or die(mysql_error()."<br /><br />".$query); $num=mysql_numrows($results); if ($num >0) { $result = mysql_fetch_array($results); $_SESSION['username'] = $username; $_SESSION['address'] = $result['address']; $_SESSION['end_date'] = $result['end_date']; $_SESSION['premium'] = $result['premium']; $_SESSION['psword'] = $psword; $_SESSION['phone'] = $result['phone']; $_SESSION['email'] = $result['email']; $update = "UPDATE `login` SET `online`=1 WHERE `id`=" . $result['id']; mysql_query($update); (header("location: index.php")); Link to comment https://forums.phpfreaks.com/topic/96374-sessions-question/ Share on other sites More sharing options...
thebadbad Posted March 16, 2008 Share Posted March 16, 2008 Where are you setting $username and $psword? Link to comment https://forums.phpfreaks.com/topic/96374-sessions-question/#findComment-493283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.