trying to navigate to a page

Posted on 2012-03-17
Medium Priority
Last Modified: 2012-06-27
hi everyone
In my index.php file I have a form used for logging in which has login.php as the action

in login.php I have


require_once 'cls_user.php';

if (isset($_POST['uid']) && isset($_POST['pwd']))
    $user = new user;
    if ($user->authenticate())
        //echo "authenticated!";


Open in new window

when the user class authenticates the login it starts a session variable, the idea being when   returning control back to index.php it sees the session variable has been set and acknowledges the user.

the problem is that the 'header' command isn't doing anything, I thought it would go back to index.php but instead I just get a blank screen (or just 'authenticated!' if I uncomment it)

how can I make it go back to index.php or what approach do I need to make it work
Question by:Natchiket

Accepted Solution

WebF00L earned 2000 total points
ID: 37733081

header("Location: index.php");

Open in new window

LVL 111

Expert Comment

by:Ray Paseur
ID: 37734668
This article shows the design pattern used for PHP client authentication.

Consider adding error_reporting(E_ALL); to your scripts.  It will save you a lot of trouble because you will be able to see many things that PHP might be hiding from you in its default condition of Notice suppression.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question