Jump to content

foreach & header redirect ... endless loop - help!


doa24uk

Recommended Posts

Hi guys,

 

Ok here's the script.

 

if(in_array($forumid, $fid_array)) {
$tests = array($forumid,);
foreach($tests as $t) {
if(preg_match('#\[(hide|HIDE)\].*?\[/\1\]#', $t)) {
// DO NOTHING
} else {
header ("Location: $url"); 
echo "Hide tags aren't there, run error procedure<br>";
return;
}
}
}

 

This works fine, the problem i've got is when the statement ISN'T true I want the script to go back to the referring page & echo some text to tell teh user what to do.

 

The problem is that the above script simply keeps seeing the result as false & endlessly redirects back to itself. It doesn't stop after the first redirect to give the user a chance to rectify the problem.

 

Am I going about this the wrong way??

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.