well im trying to work out sessions for a login page ive done. basically the way it goes is there are four types of access levels. their login info is firstname, lastname, and dob. from that info, i get the person_ID, which determines what type of person they are. my login.htm is just the form page. the login.php looks like so.
<?php
session_start(hi);
session_register("id","firstname","lastname");
?>
<?php
global $submit;
global $Person_ID;
global $id;
global $Owner;
global $firstname;
global $lastname;
?>
<?php
if ($submit) {
$db = mysql_connect("localhost", "root");
mysql_select_db("Health",$db);
$result = mysql_query("SELECT FROM persons WHERE First_Name='$First_Name' AND Last_Name='$Last_Name' AND DOB='$DOB'",$db);
if ($myrow = mysql_fetch_array($result)) {
$id=$myrow["Person_ID"];
$firstname=$myrow["First_Name"];
$lastname=$myrow["Last_Name"];
}
}
$db = mysql_connect("localhost", "root");
mysql_select_db("Health",$db);
$result = mysql_query("SELECT FROM receptionist WHERE Person_ID='$id'");
$result1 = mysql_query("SELECT FROM customers WHERE Person_ID='$id'");
$result2 = mysql_query("SELECT FROM practitioners WHERE Person_ID='$id'");
$result3 = mysql_query("SELECT * FROM practitioners WHERE Person_ID='$id' AND Owner='Yes'");
$session=session_id();
if ($myrow = mysql_fetch_array($result)) {
header("location: http://192.168.0.2/site/receptionist/RecPage.htm?");
} else {
if ($myrow1 = mysql_fetch_array($result1)) {
header("location: http://192.168.0.2/site/customer/CustPage.htm");
} else {
if ($myrow3 = mysql_fetch_array($result3)) {
header("location: http://192.168.0.2/site/owner/OwnPage.htm");
} else {
if ($myrow2 = mysql_fetch_array($result2)) {
header("location: http://192.168.0.2/site/practitioner/PracPage.htm");
} else {
echo "No one with those details is registered at this time";
echo "Please use your browsers back button to try again";
}
}
}
}
?>
and on the page its passing to, the recpage one, ive got this little bit
<?php
session_start(hi);
session_register("id","firstname","lastname");
?>
<?php
printf(session_id("firstname"));
?>
when i run that, i get one long line "748ee2924d78dac44c2d503710abbc48 " on the rec page. i just cant figure it out and would appreciate some advice. thanks
mark