Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Simple PHP Application Integrating with PayPal Redirecting Invalid Shirt IDs

James Wong
James Wong
3,431 Points

How to deal with "redirect loop" notifications in Chrome?

My Chrome browser sends me to a screen that notifies me that the page has a redirect loop, not shirt.php. How can we prevent this?

2 Answers

Jamie Barton
Jamie Barton
14,498 Points

Like the error says, you will have a redirect loop in your code so the browser can't render the page because somewhere in your code nothing is returning a final result.

Check any while or if/else statements and make sure one of them can result to true and return something.

You could be calling the function you're inside.

If you share your code we'd be more than happy to have a look to spot the error for you.

Have a nice day.

:)

James Wong
James Wong
3,431 Points

Thanks for the reponse! I'll look into my code to spot any errors =i