Skip to main content

Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #24496
    justinmyoung
    Member

    Hello

    I’m working on implementing a basic php registration and login script from evolt.org http://www.evolt.org/article/PHP_Login_System_with_Admin_Features/17/60384/index.html. I have it up and running on my server, and it works fine. However, I’m a little uncertain how to protect a page from non-registered users. Once a user registers, they can access a certain page.

    What I have in mind is simply allowing a user to register, and once registered, allowing that user access to another form where that information entered into that form is entered into the database under that users name. Like a contest where you have to be registered to play the contest, and once you are registered you can submit your answers.

    I have the login authentication and registration working, but am stuck on how to do the above.

    Here’s the main.php script that a user is greeted with:

    Code:


    Jpmaster77’s Login Script

    logged_in){
    echo “

    Logged In

    “;
    echo “Welcome $session->username, you are logged in.


    .”[username”>My Account]   ”
    .”[Edit Account]   “;
    if($session->isAdmin()){
    echo “[Admin Center]   “;
    }
    echo “[Logout]”;
    }
    else{
    ?>

    Login

    num_errors > 0){
    echo ““.$form->num_errors.” error(s) found“;
    }
    ?>

    Username: value(“remember”) != “”){ echo “checked”; } ?>>
    Remember me next time     

    [Forgot Password?]
    Not registered? Sign-Up!

    “;
    echo “Member Total: “.$database->getNumMembers().”
    “;
    echo “There are $database->num_active_users registered members and “;
    echo “$database->num_active_guests guests viewing the site.

    “;

    include(“include/view_active.php”);

    ?>


    Any suggestions?

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.