Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.