Jump to content

Sessions made Personal


jfs0479

Recommended Posts

Hi all,

 

I am just building a site for someone and i was wondering how can we make a session personal so when someone looks in their previous sessions in their browse they will be able to see Arabian Airlines rather than PHPSESSION? Below is the code i currently use to create the session.

 

<?
session_start();

header("Location: crew_department.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Arabian Login Check</title>
</head>

<body>
<?php
include 'db.php';

$pid = $_POST['pid'];

$password1 = $_POST['password1'];



if((!$pid) || (!$password1)){

echo "Please enter ALL of the information for your login! <br />";

include 'login.php';

exit();

}



$sql = mysql_query("SELECT * FROM bluepilots WHERE pid='$pid' AND password1='$password1' AND level='2'");

$login_check = mysql_num_rows($sql);



if($login_check > 0){

while($row = mysql_fetch_array($sql)){

foreach( $row AS $key => $val ){

	$$key = stripslashes( $val );

}

	//Register session variables.
	session_register('pid');

	$_SESSION['pid'] = $pid;

	session_register('password1');

	$_SESSION['password1'] = $password1;

	session_register('firstname');

	$_SESSION['firstname'] = $firstname;

	session_register('lastname');

	$_SESSION['lastname'] = $lastname;

	session_register('email1');

	$_SESSION['email1'] = $email1;

	session_register('country');

	$_SESSION['country'] = $country;

	session_register('networks');

	$_SESSION['networks'] = $networks;

	session_register('aboutyou');

	$_SESSION['aboutyou'] = $aboutyou;
}

}
?>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/43847-sessions-made-personal/
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.