Hi i am building a login page with sessions.
The idea is that people can login and then get send to another page where they can do new things.
The first page has a few variables which i need in the second page.
So after the first page's session start()
i want to add a variabele to the session.
user_password with value 1234b
and user_login with value "bob"
then i want to read out these variables in the second page and use them in an sql statement.
how do i do this?
anyone knows some good reading on sessionvariables?
till now i have this:
1st page:
//some code
$Results = mysql_num_rows($Query);
$results2 = mysql_fetch_array($Query);
if ($Results == '1')
//username and password are ok
{
$_SESSION[user_login]=$results2['user_login'];
$_SESSION['user_password']='$user_password';
$_SESSION['blaat']=$results2['blaat'];
//some more code
2nd page
<?php
//Login needed for this page
session_start();
//get values out of session
$user_login = $_SESSION['user_login'];
$user_password = $_SESSION['user_password'];
$blaat = $_SESSION['blaat'];
$query = mysql_query("select * from user where user_password = $user_password and user_login = $user_login;")
?>
I appreciate all help i can get!
thanks in advance!