• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

The page isn't redirecting properly

Hi Experts,

I've just uploaded a PHP code that works on my localhost, but on the server FF gives me:

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.


IE just hangs.

The code behind this is
  $user = $_POST['txtUser'];
        $password = $_POST['txtPassword'];
        $login_status = Login::verify_login($user, $password);
    
        if ($login_status == 'admin') {
            header('Location: index.php?action=list');
        } 
        else if ($login_status == 'rs') {
            header('Location: ../dispatch');
        } 
        else {
            header('Location: ../?type=err&msg=User Id / Password combination not found.');
        }
      

Open in new window


What could it be?  Again, under localhost, no issues..
0
APD Toronto
Asked:
APD Toronto
  • 3
  • 3
  • 2
2 Solutions
 
gr8gonzoConsultantCommented:
Always add a die() underneath header() lines that redirect the Location. Not sure if it's relevant, but it'll avoid continuing to run the script, which could introduce unexpected behavior.
0
 
APD TorontoAuthor Commented:
Still happening
0
 
gr8gonzoConsultantCommented:
Install Fiddler if you don't already have it installed, then turn it on to start capturing requests and reproduce the problem. It should tell you all the redirects that are happening.
0
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

 
APD TorontoAuthor Commented:
Fiddler?
0
 
Dave BaldwinFixer of ProblemsCommented:
In this one...
header('Location: ../?type=err&msg=User Id / Password combination not found.');

Open in new window

'/' is not a 'legal' character in a query string.  It must be urlencoded or percent encoded.  %2F
header('Location: ../?type=err&msg=User Id %2F Password combination not found.');

Open in new window

0
 
Dave BaldwinFixer of ProblemsCommented:
Fiddler - network debugging tool.
http://www.telerik.com/fiddler
0
 
APD TorontoAuthor Commented:
Thanks
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now