Mr_J Posted September 10, 2008 Share Posted September 10, 2008 Please see: http://www.phpfreaks.com/forums/index.php/topic,215800.0.html So I did the following: <?php header("location:products.php"); //this is what I added and page doen`t load $tel = "0861 111 589" ; $fax = "(018) 462 5263" ; $email = "mailform.php" ; header("location:$email"); $web = "http://www.medbel.co.za" ; ?> The error: (FireFox) Redirect Loop Firefox has detected that the server is redirecting the request for this address in a way that will never complete. The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete. * Have you disabled or blocked cookies required by this site? * NOTE: If accepting the site's cookies does not resolve the problem, it is likely a server configuration issue and not your computer. IE7 simply do not load the page... The page must first echo this: <td width="60%" align="center"> <?php echo "Send Comments or e-Mail: "; echo $email; ?> </td> OnClick it must goto "mailform.php" If I do not give this... header("location:products.php"); it jumps directly to the mailform Link to comment https://forums.phpfreaks.com/topic/123624-header-load-2-soon/ Share on other sites More sharing options...
DamienRoche Posted September 10, 2008 Share Posted September 10, 2008 Hey Mr_J, glad I could help before. First thing is to put the header("location:products.php"); on the very first line, immediately after the <?php. Only separate with a space, not a carriage return. Second, make sure 'products.php' is in the same directory as the .php file. To be sure, you can add an absolute url, like header("location:http://yourdomain.com/pages/products.php"); Another thing I noticed is that the second set of code calls $email. BUt $email is set as mailform.php and not header("location:mailform.php"); so I'm not entirely sure why it's even redirecting. Plus, using an OnClick Javascript event handler is not ideal as some people will have it disabled, thus rendering the functioning of this page incomplete. Is the first set of code actually in 'products.php' ? if so, that's why it won't work because it just calling itself and creating a "Redirect Loop" as Firefox described it. There's a few things to help your troubleshooting, and bump this thread Link to comment https://forums.phpfreaks.com/topic/123624-header-load-2-soon/#findComment-638490 Share on other sites More sharing options...
Mchl Posted September 10, 2008 Share Posted September 10, 2008 Is this code by any chance in products.php ? <?php header("location:products.php"); //this is what I added and page doen`t load $tel = "0861 111 589" ; $fax = "(018) 462 5263" ; $email = "mailform.php" ; header("location:$email"); $web = "http://www.medbel.co.za" ; ?> Link to comment https://forums.phpfreaks.com/topic/123624-header-load-2-soon/#findComment-638507 Share on other sites More sharing options...
shedokan Posted September 10, 2008 Share Posted September 10, 2008 the problem is tht you redirect the file to itself and it redirects to itself over and over again. Link to comment https://forums.phpfreaks.com/topic/123624-header-load-2-soon/#findComment-638584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.