doa24uk Posted September 28, 2008 Share Posted September 28, 2008 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?? Link to comment https://forums.phpfreaks.com/topic/126144-foreach-header-redirect-endless-loop-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.