user1031721
user1031721

Reputation:

Disable Redirect Loop

Is there any way to disable the Error 310 (Redirect Loop) checking or is there any browser (can be old) that does not have this checking feature?

I need it for a php script i wrote that checks a file with file_get_contents, and it know what file it is by an id i pass to it, then it redirects to the same page with a different id.

Thanks!

Upvotes: 0

Views: 2044

Answers (1)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324630

Instead of using header("Location: ...");, try this:

die('<script type="text/javascript">location.href = "'.$new_location.'";</script>');

This will circumvent the redirect loop error.

EDIT: Even better:

die('Some progress information here...
     <script type="text/javascript">
          setTimeout(function() {location.href = "'.$new_location.'"},50);
     </script>');

This way you can display some progress information.

Upvotes: 2

Related Questions