I'm using this function (checkUID) to add a querysting to a URL for a shopping cart we are using at work.
For some odd reason, when i use Netscape 4.7 i can't get to Page2.php of the shopping cart. All it does it just redirect to the same page (Page1.php). The function works fine in any other browser (I haven't checked lynx yet though).
Page1.php
intro stuff
link to page2.php
<a href="Page2.php">Go Shopping!</a>
Page2.php
give UID if not present in URL
shopping cart code
here's how to code looks at top of this page
<?php
checkUID($UID);
......
?>
now here's the checkUID function.
function checkUID($UID){
// global $UID;
global $dbServerConn;
if ($UID != "") {
$result = mysql_query("SELECT * FROM Users WHERE User='$UID'",$dbServerConn);
$num=mysql_num_rows($result);
if ($num == "0") {
$UID=md5(uniqid($REMOTE_ADDR));
$date=date("z");
mysql_query("INSERT INTO Users VALUES ('$UID','$date')",$dbServerConn);
Header("Location: $PHP_SELF?UID=$UID");
}
}
if ($UID == "") {
$UID=md5(uniqid($REMOTE_ADDR));
$date=date("z");
mysql_query("INSERT INTO Users VALUES ('$UID','$date')",$dbServerConn);
Header("Location: $PHP_SELF?UID=$UID");
}
}
Thanks.