once logged in how to direct user to their unique page based on their DB info
ok i have got the user creating a username, password and id. once they logged i want to be able to send them to a page containing information from their inputted information in the database. I was thinking of session varialble to load the information in from the database based on the user id so this is what i done
here is the code
login check page php
<?
$userid=mysql_real_escape_string($userid);
$password=mysql_real_escape_string($password);
if($rec=mysql_fetch_array(mysql_query("SELECT * FROM Hdatabase WHERE userid='$userid' AND password = '$password'"))){
if(($rec['userid']==$userid)&&($rec['password']==$password)){
include "include/newsession.php";
echo "<p class="data"> <center>Successfully,Logged in<br><br><a href='logout.php'> Log OUT </a><br><br><a href=welcome.php>Click here if your browser is not redirecting automatically or you don't want to wait.</a><br></center>";
print "<script>";
print " self.location='welcome.php';"; // Comment this line if you don't want to redirect
print "</script>";
}
}
else {
session_unset();
echo "<font face='Verdana' size='2' color=red>Wrong Login. Use your correct Userid and Password and Try <br><center><input type='button' value='Retry' onClick='history.go(-1)'></center>";
}
?>
this is the newsessions php
<?php
//error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR);
$session['id']=session_id();
$session['userid']=$userid;
$session['name']=$name; this is one i have added
//echo $session['userid'];
?>
this is where i though i added new sessions then place them into the welcome page?
add this is a new session i have added from the welcome.php
<?
echo "$session[name]";
?>
i hope you can help
