Jump to content

SESSIONS Problem!


shoaibi

Recommended Posts

You need to use post with or with out sessions to get the session to do somthink ha.

test.php
<?session_start();

$name=."my name is redarrow";
$age=."MY age is 31";

$name$_POST['name']
$age=$_POST['age'];

$_SESSION['name']=$name;
$_SESSION['age']=$age;

echo"<a href='test_rsult.php'>test me</a>";

?>

test_result
<?session_start();

echo "<br>$name:$age<br>";

?>
Ok idk what to do, here is the session code I ussually use:
[code=php:0]class session
{
function start($auth = true)
{
session_start();

if(!isset($_SESSION['user_id']) && $auth)
{
header('Location: login.php');
exit;
}
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
define('LOGGED_IN', (isset($_SESSION['logged_in'])) ?  $_SESSION['logged_in'] : false);
}
function destroy()
{
$_SESSION = array();
session_destroy();
}
}[/code]

Try that and see if it works.

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.