Hi, I am having a bit of trouble getting my head rounf Session Variables at the moment.
I have the following code
<?php
session_start();
require_once ("../../mysql_connect_personal.php");
$query = "SELECT * FROM user_details WHERE user_id = '$user'";
$result = @mysql_query($query);
$item = mysql_fetch_array($result);
if ($item["user_id"]==$user) {
if ($item["user_password"]==$pass) {
$_SESSION["user_id"]=$item["user_id"];
$_SESSION['user_company_name']=$item["user_company_name"];
header("Location: . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/check_user.php");
}
}
?>
I get the old "Cannot add header information" warning.
Now, I may be being thick, but if I put the header information under the session_start() function, how will the variables be populated?
I have the following code
<?php
session_start();
require_once ("../../mysql_connect_personal.php");
$query = "SELECT * FROM user_details WHERE user_id = '$user'";
$result = @mysql_query($query);
$item = mysql_fetch_array($result);
if ($item["user_id"]==$user) {
if ($item["user_password"]==$pass) {
$_SESSION["user_id"]=$item["user_id"];
$_SESSION['user_company_name']=$item["user_company_name"];
header("Location: . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/check_user.php");
}
}
?>
I get the old "Cannot add header information" warning.
Now, I may be being thick, but if I put the header information under the session_start() function, how will the variables be populated?