Hi, im looking for a link to a secure login script in php or a link to a tut that will teach be how to make this please, i would prefer it to be the tut and if it had email verifiction that would be great. any help would be fantastic

P.s i posted this in the wrong forum earlier, sorry 🙁

    hi, i found a tut to a login script on this site, the link is

    http://www.phpbuilder.com/columns/tim20000505.php3?page=1

    ive got the main part working ok, but what i need to know is how i can stop people from going around the login and just typing in the addrress to the file like

    www.thephoenixporject.co.uk/Serenity/test/main.php (this is wher they are redirected to when they login in)

    i tried to put at the top of the page but i guess its wrong

    <?

    include($DOCUMENT_ROOT.'/Serenity/test/database.php');
    include($DOCUMENT_ROOT.'/Serenity/test/pre.php');
    include($DOCUMENT_ROOT.'/Serenity/test/user.php');

    if (user_isloggedin()) {
    echo 'Welcome you are Logged in';
    } else {
    echo 'Welcome you are Not Logged in';
    }
    ?>

    i am a complet noob to php and any help would be great, also is this login secure?

      okto have alogin you ned someway of storing a users login details most favourable is teh database;

      you then need to create the login form, which passes data to a php3 file to process it to make my logins secure i MD5() encrypt all my password so thay cant be decrypted, then al you have to do is compar they encrypted database stored pword ith theone the suer entered then you set a sessions cariable that elts them view loggin pages?

        if you are useing sessions and you dont want ppl to beable to go to your main page without logging in is simple just do this

        //to check if they are logged in with sessions
        
        if(isset($_SESSION['user'])) {
        you main page code here
        }else{
        echo "sorry you are not logged in <a href=your login page.php>Log-in now</a>
        }
        
        

        with that little bit of code it will check to see if sessions are started by being logged in if they are they will beable to view you main page and if they are not all they will see is sorry you are not logged in <a href=your login page.php>Log-in now</a>

        hopfully this is what you are looking for

          ahh, thats great thanks very much every body

            Write a Reply...