Forum Moderators: coopster
"Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked"
What i did was make a HTML form that uses PHP_SELF to validate itself before it goes onto the next stage.
I used the var $error. If an error is picked up, it would display that error (nothing wrong with this...)
But it there isnt an error, I asked it to do the following:
if (!$error) {
$querystring = explode ('process=',$_SERVER['QUERY_STRING']);
$newquerystring = $querystring[1] + 1;
header ("Location: [".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$querystring[0]."process=".$newquerystring."");...]
}
where $querystring = "table=packages&package=intermediate&get=signup&process=2" and so on, ie, the header location should be:
http:// myserverthingy.watever/thefile.php?table=packages&package=intermediate&get=signup&process=3
(A space after http:// was purposely added)
Any got any suggestions?
You might try looking for that sort of thing, or comment your code one line at a time until the problem stops.
Hope that helps some...
Here is my validation code:
// validate the data
if ($validate) {
// validate email
//print_r ("$Email, $Vemail");
//exit();
if (eregi("^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $Email)) { }
else { $error = "Email"; }
if ($Email!= "$Vemail") {
$error = "Vemail";
}
// validate postcode
function cleanupPostCode ($PostCode) {
$PostCode = strtoupper($PostCode);
$PostCode = ereg_replace('[[:punct:]]', ' ', $PostCode);
$PostCode = ereg_replace('[[:space:]]+', ' ', $PostCode);
$PostCode = str_replace(' O',' 0', $PostCode);
if ($PostCode{0} == '0') $PostCode{0} = 'O';
if ($PostCode{1} == '0') $PostCode{1} = 'O';
return $PostCode;
}
$PostCode = cleanupPostCode($PostCode);
if(eregi('^(([A-Z][A-Z]?)([1-9]*[0-9A-HJ-RT-Y]?))¦(BFPO)?(([0-9]{1}[ABD-HJLNP-UW-Z]{1,2})¦([0-9]{2}))$', $PostCode)) { }
else { $error = "PostCode"; }
// validate password
if (preg_match("/^[a-z0-9]{4,12}$/i",$Password)) { }
else { $error = "Password"; }
if ($Password!= "$VPassword") {
$error = "VPassword";
}
// validate domain
if (preg_match('#^http\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $domain)) { }
else { $error = "domain";}
// end validation
if ($error) {
print("$error");
exit();
}
}
And the header code is posted above. I don't get this loop thing, why is it looping itself?
Thanks for all the help! I'm gonna try and help someone onday! :D