Jump to content

Sessions Question


affordit

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.