Hi Forum,
I've set up the following code in Events | Edit Page: before process
echo "editid1 value is: " . $_REQUEST["editid1"] . "<br />";
global $conn, $strTableName;
$str = "select Fieldname1, Fieldname2, Fieldname3 from my_table where ID=".$_REQUEST["editid1"];
$rs = db_query($str,$conn);
$data = db_fetch_array($rs);
echo "Session Email: " . $_SESSION["email"] . "<br />";
echo "Fieldname1 value is: " . $data["Fieldname1"] . "<br />";
echo "Fieldname2 value is: " . $data["Fieldname2"] . "<br />";
echo "Fieldname3 value is: " . $data["Fieldname3"] . "<br />";
if (($data["Fieldname1"]== '1') && ($data["Fieldname3"]==$_SESSION["email"])) {
header("Location: http://www.mywebsite.com/errpage1_list.php");
exit();
}
if (($data["Fieldname1"]== '1') && ($data["Fieldname3"]<>$_SESSION["email"])) {
header("Location: http://www.mywebsite.com/errpage2_list.php");
exit();
}
if (($data["Fieldname2"]== '1') && ($data["Fieldname3"]==$_SESSION["email"])) {
header("Location: http://www.mywebsite.com/errpage3_list.php");
exit();
}
if (($data["Fieldname2"]== '1') && ($data["Fieldname3"]<>$_SESSION["email"])) {
header("Location: http://www.mywebsite.com/errpage4_list.php");
exit();
}
Here's the problem
When a user logs in and simply enters the url below into the browser or via a link the values of Fieldname1, Fieldname2, Fieldname3 are not being pulled from the table 'my_table'. As a result the IF conditions cannot be carried out. By the way the S_SESSION["email"] is pulled from login and echoes correctly as does $_REQUEST["editid1"]
http://www.mywebsite.com/my_table_edit.php?editid1=895
Your help would be much appreciated.
Lisa