Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

PHP Problems

  • 06-11-2012 08:03PM
    #1
    Closed Accounts Posts: 1


    I'm really sorry to bother you, I wouldn't ask this if I thought I hadn't exhausted any other option but i'm starting to experience a serious problem with one of my code strings, I keep getting: The webpage at http://localhost/mmos/validate.php has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer. I was wondering if you could spot whats going on? The page was designed to 'recieve' the link from the validating email, prompt a user for his/her password and if the password was correct activate the account, if the password was wrong, redirect the page back to itself. http://pastebin.com/uGqEh77Gcleardot.gif


Comments

  • Closed Accounts Posts: 7,144 ✭✭✭DonkeyStyle \o/


    Check line 62, you've got two closing braces before the 'else', and a missing closing brace after it. The closing brace that's after else belongs to the parent 'if'.
    Probably what's happening is that it's unconditionally redirecting to itself over and over again.
    If you lay out your code with indents and dropped braces (below 'if' rather than after 'if'), it's a lot easier to see what's going wrong in this respect.


  • Registered Users, Registered Users 2 Posts: 26,449 ✭✭✭✭Creamy Goodness


    also, 9 times out of 10, you'll want to call exit; after doing an header('Location: xxx.php"); call.

    if you don't exit php will execute the rest of the current file afterwards when that may not be the intended behaviour.


Advertisement