PDA

View Full Version : Login Script || THE BEST ||



:Lively
23-10-2005, 03:45 PM
Hi, i need the best possible login script to keep staff logins as safe as possible.

Can sum1 help!

RYANNNNN
23-10-2005, 03:49 PM
What are you looking for?

What features? or just a passworded page?

:Lively
23-10-2005, 03:50 PM
jus a password page thx,

and i want it to be as secure as possible plz

Flisker
23-10-2005, 03:58 PM
Then it has to be a php one try www.zymic.com or www.thybag.co.uk or even Google It ;)

nelly
23-10-2005, 04:09 PM
I'm sure dreamweaver makes them Lol i'll try for you


also chris unblock me >:(

RYANNNNN
23-10-2005, 04:12 PM
?php

// Define your username and password
$username = "someuser";
$password = "somepassword";

if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {

?>

<h1>Login</h1>

<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p><label for="txtUsername">Username:</label>
<br /><input type="text" title="Enter your Username" name="txtUsername" /></p>

<p><label for="txtpassword">Password:</label>
<br /><input type="password" title="Enter your password" name="txtPassword" /></p>

<p><input type="submit" name="Submit" value="Login" /></p>

</form>

<?php

}
else {

?>

<p>This is the protected page. Your private content goes here.</p>

<?php

}

?>

There, i've posted this on habboforum aswell.

Tomm
23-10-2005, 04:20 PM
?php

// Define your username and password
$username = "someuser";
$password = "somepassword";

if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {

?>

<h1>Login</h1>

<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p><label for="txtUsername">Username:</label>
<br /><input type="text" title="Enter your Username" name="txtUsername" /></p>

<p><label for="txtpassword">Password:</label>
<br /><input type="password" title="Enter your password" name="txtPassword" /></p>

<p><input type="submit" name="Submit" value="Login" /></p>

</form>

<?php

}
else {

?>

<p>This is the protected page. Your private content goes here.</p>

<?php

}

?>
There, i've posted this on habboforum aswell.

Its not really very good but its simple and ok for the basic user.

RYANNNNN
23-10-2005, 04:32 PM
Its not really very good but its simple and ok for the basic user.

Agreed, my other one using mysql databases and sessions is better, but this guy seems new to PHP.

splintercell!
23-10-2005, 07:28 PM
you could set a session and then on other hidden pages check if one has been set to add securiity... also..


I'm sure dreamweaver makes them Lol i'll try for you
shut the **** up.

Tomm
23-10-2005, 07:37 PM
you could set a session and then on other hidden pages check if one has been set to add securiity... also..


shut the **** up.

Dreamweaver dose make them but there not very secure lol it submits the password useing GET and dosent even MD5 encript it lol

splintercell!
23-10-2005, 07:52 PM
I know he just ****es me of the way he thinks webdesign is just Dreamweaver "/

nelly
23-10-2005, 08:06 PM
shut up will you you think your best but your not and before you say i'm better than you i nkow you are so SHUT UP (Show Off)
I know he just ****es me of the way he thinks webdesign is just Dreamweaver "/

Mentor
23-10-2005, 08:17 PM
I know he just ****es me of the way he thinks webdesign is just Dreamweaver "/
I feel your pain.
Password systems are pretty simple realy, for ultra simplicty u can just do it server side via htaccess and all that, or in cpnale it does that itself on the proected diretys thing "/
Athogh to look nice or anything a simple php systems a easy soltuion "/ i prefer to use cookies, athoghs mainly becuse my orignal exspeince with sessions didnt go so well, as to say it didnt work, so ive stuck with cookies mainly "/

:Lively
23-10-2005, 08:18 PM
can u give me the one which uses mysql and sessions plz

Luckyrare
23-10-2005, 08:20 PM
The only time I use dream weaver for PHP is when I need to find a line number... EG) Adding forum/cutenews mods


But you can't make scripts just clicking buttons on dream weaver...

Mentor
23-10-2005, 08:23 PM
I occasonly use it for code highlingting, but i acatly prefer phpexspert, as its not so resorce intencive, athogh it sometimes gets confused when runing the codeing "/ so isnt perfect

Temporary
24-10-2005, 05:31 PM
Now to make a login script for your website. open wordpad or an editor and enter this code and save it as config.php

<?php

//////////////////////////////////////////////////////
// Admin Login scrip by by: //
// HotelMentor //
// //
// Copyright 2005(c) //
//////////////////////////////////////////////////////

$username = "Username";//You should replace Usernamehere with your desired username
$password = "Password";//You should replace Passwordhere with the desired password
$location = "http://www.location here.com";//The location that the person needs authenticiation to should replace www.location here.com
//DO NOT REMOVE THE HTPP://, also do an exact location, like: http://www.comcast.net/
$badinfo = "Sorry, the information you have entered is not valid. Please try again.";//The message that should appear when the user information is bad should replace Die message //here
$noinfo = "No information here.";//The message that should appear when one or more of the fileds are empty should replace No Info Here
?>

Next. make a new page and name it form.php
enter this code


///////////////////////////////////////////////////////////////////
//This section of the script was created by HotelMentor //
/////////////////////////////////////////////////////////////////
<body bgcolor="#f2f2f2">
<style type="text/css"><!--
BODY {
scrollbar-face-color:#F2F2F2;
scrollbar-highlight-color:#F2F2F2;
scrollbar-3dlight-color:#F2F2F2;
scrollbar-darkshadow-color:#F2F2F2;
scrollbar-shadow-color:#F2F2F2;
scrollbar-arrow-color:#000000;
scrollbar-track-color:#F2F2F2;
}
--></style>
<form name="form1" method="post" action="">
<p><font face="Verdana" size="1">Username:</font>
<input name="userinput" type="text" id="userinput">
<br>
<br>
<font face="Verdana" size="1">Password:</font>
<input name="passinput" type="password" id="passinput">
<br>
<br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset">
<input name="action" type="hidden" id="action" value="submit">
</p>
</form>

Now the final step. new page once again. name it login.php enter this code.

<?php
include('config.php');

if($action == "submit"){
if(($userinput == "")||($passinput == "")){
echo "$noinfo";
} else {
if(($userinput == $username)&&($passinput == $password)){
header( "Location: $location" );
} else {
echo "$badinfo";
}
}
}
include('form.php') ;
?>
And now upload these to the public html.
Heres the readme to configure.

Hello, before you get started, read this to learn how to use it.

1) For your users to login, simply redirect them to http://www.yoursite.com/login.php
2) Do NOT change the form.php file.

If you want to change the username, password or redirection URL, simply:

1) Open (edit) config.php.
2) If you'd like to change the password, change the "blah" part of $password = "blah".
3) If you'd like to change the location URL, change the "location.here.com..." in $location = "http://www.location here.com".
4) Do NOT change the rest and enjoy the script.

Created by Gerard Gargan (HotelMentor / Temporary) for www.habboid.co.uk.
Copyright 2005(c)

Sygon
25-10-2005, 12:02 PM
you could set a session and then on other hidden pages check if one has been set to add securiity... also..


shut the **** up.

Lmao man your to funny

мϊкэ
25-10-2005, 03:33 PM
erm.. www.biorust.com has alot of tutorials on making scripts like that but they use mysql.. you can also download a full pre-made script from there.. www.time-2-design.com has a few aswell.. but theyre membership systems.. but they can easily be applied to what you want ;)


shut the **** up.

Rofl! Splint.. you say what we're all thinking

Want to hide these adverts? Register an account for free!