I'm running php 4.2.3 on Apache 1.3.27 on FBSD4.7.
I just moved some scripts from and old server with "register_globals" on to this one with the rgs turned off.
I'm trying to get my head around the new variable format Some times I feel really old as I can't seem to understand it.
The snip below works OK with rgs on but goes into an endless loop continously adding records to the DB with them off. I've tries playing with the $_[*] declarations but can't work it out.
Can someone give me a hand here please?
TIA
Howard
<snip>
if ($uid != ""
{
$result=mysql("$DBName","SELECT * FROM Users WHERE User='$uid'"
;
$num=mysql_num_rows($result);
if ($num == "0"
{
$dt=date("YmdHi"
;
$uid="$dt$ip";
$date=date("z"
;
mysql("$DBName","INSERT INTO Users VALUES ('$uid','$date')"
;
Header("Location: $PHP_SELF?UID=".$uid);
}
}
if ($uid == ""
{
$dt=date("YmdHi"
;
$uid="$dt$ip";
$date=date("z"
;
mysql("$DBName","INSERT INTO Users VALUES ('$uid','$date')"
;
Header("Location: $PHP_SELF?UID=".$uid);
}
<snip>
I just moved some scripts from and old server with "register_globals" on to this one with the rgs turned off.
I'm trying to get my head around the new variable format Some times I feel really old as I can't seem to understand it.
The snip below works OK with rgs on but goes into an endless loop continously adding records to the DB with them off. I've tries playing with the $_[*] declarations but can't work it out.
Can someone give me a hand here please?
TIA
Howard
<snip>
if ($uid != ""
$result=mysql("$DBName","SELECT * FROM Users WHERE User='$uid'"
$num=mysql_num_rows($result);
if ($num == "0"
$dt=date("YmdHi"
$uid="$dt$ip";
$date=date("z"
mysql("$DBName","INSERT INTO Users VALUES ('$uid','$date')"
Header("Location: $PHP_SELF?UID=".$uid);
}
}
if ($uid == ""
$dt=date("YmdHi"
$uid="$dt$ip";
$date=date("z"
mysql("$DBName","INSERT INTO Users VALUES ('$uid','$date')"
Header("Location: $PHP_SELF?UID=".$uid);
}
<snip>