Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PHP Problems

Options
  • 06-11-2012 9: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,145 ✭✭✭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 Posts: 26,571 ✭✭✭✭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