Looking for a login script

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
(Also posted to alt.php on 16 Aug 07)

Good day -

I am looking for a log-in script that I can use for a project. I'm pretty
inexperienced but I want to teach myself some PHP. The project that I've
chosen will be more useful and easier to manage if I have a log-in area. But
I don't think that I can create such a script by myself.

So I'd appreciate opinions on something suitable - the site won't be huge
and wont have a huge number of users, I don't think. I am willing to pay for
a good package but free is, of course, good as well if the script is proven.

Thanks in advance for your assistance.

Steve E.

Re: Looking for a login script

On Fri, 17 Aug 2007 12:27:03 GMT, "Serious_Practitioner"

Quoted text here. Click to load it

script you want to protect:
if ($_GET['user']){
include 'loginscript.php';


function securityCheck($user){  

$nodirectaccess = 1;
include 'config/passwords.php';
//if ($nodirectaccess != 1)
//$admin = 'bob';
//$passwords[$admin] = 'secretpassword';
//$passwords[USER] = 'PASS';
//$passwords['user1'] = 'test1';

$userpassword = $passwords[$user];

if ( (!isset($_POST["user"])) OR (!isset($_POST["userpassword"]))){$tests

if (($_POST["user"] == $user) AND ($_POST["userpassword"] == $userpassword))
    {    setcookie("password", $userpassword, time()+60*60*24*2999,
    $tests ='good';}
if (($_COOKIE["password"] == $userpassword)AND(isset($_COOKIE["password"]))){
// or admin
if (($_POST["user"] == $admin) AND ($_POST["userpassword"] ==
    {    setcookie("password", $passwords[$admin], time()+60*60*24*2999,
    $tests ='good';}
if (($_COOKIE["password"] ==
// end or admin

if ($tests !='good'){
echo '<br /><br /><br />';

    if ($tests !='nottaken'){echo "Sorry, you've entered the wrong info. ";}
     echo '
     <form action="'.$_SERVER['REQUEST_URI'].'" method="post"
            user name:   <input type="text" name="user" size="8"
             password: <input name="userpassword" type="text"
            <br>then <input name="submit" type="submit" value="click
here" >
            If you have cookies enabled in your browser, you will
not have to login unless you delete your cookies.
             <br /><br /><br /></div>
    <script language="JavaScript"><!--
}// end func securityCheck()


Site Timeline