Post: simple PHP login script
02-20-2012, 06:22 AM #1
Nero.
Space Ninja
(adsbygoogle = window.adsbygoogle || []).push({}); Okay this is a basic login script that I coded.
It took about 5-10 minutes to code...

You must login or register to view this content.[/COLOR][/SIZE][/FONT]

okay to set it up you need to hash a username and a password.

Use this link
You must login or register to view this content.
now enter the hashes in at
$user
and
$pass
then edit $self

or just edit lines 20, 21 and 22 Happy

    
<style type="css/text">
textarea
{
font-family: Courier New, Courier, monospace;
font-size: 14px;
color: #000000;
border:double;
border-color:#3C3C3C;
background-color:#60D5C9;
}
hr
{
background-color: #33CCCC;
}

</style>
<?php
$passe = md5($_POST['passentry']);
$usere = md5($_POST['userentry']);
$self= 'https://thefinalstring.com';
$pass = '81dc9bdb52d04dc20036dbd8313ed055';
$user = '81dc9bdb52d04dc20036dbd8313ed055';
?>
<center>
<body text=#336666 bgcolor="#0000000" style="font-family: Courier New, Courier, monospace;
font-size: 18px;" oncontextmenu="return false;">
<form method="post">
Username:<input type="text" name="userentry" /><br>
Password:<input type="password" name="passentry" /> <br>
<input type="submit" value="Login" name="Login" />
</form></center>
</body>
<?php
echo base64_decode("PGNlbnRlcj48Zm9udCBjb2xvcj1cInJlZFwiPiBDUkVBVEVEIEJZIE5FUk8gQCA8YSBocmVmPSJodHRwOi8vdGhlZmluYWxzdHJpbmcuY29tIj4gVGhlIEZpbmFsIFN0cmluZyEgPC9hPjwvZm9udD48L2NlbnRlcj4NCg==");
?>
<?php

if (isset($_POST['Login']) && $passe===$pass && $usere===$user )
{
header('location:'.$self);
}

if(isset($_POST['Login']) && $passe== " ")
{ echo "<br><font color=red><b>Please enter a password</font></b><br>"; }

if (isset($_POST['Login']) && $usere== " ")
{
echo "<br><font color=red><b>Please enter a username</b><br></font>";
}
?>
(adsbygoogle = window.adsbygoogle || []).push({});
03-08-2012, 07:03 PM #2
JSWS
Grunt
Very Helpful, thanks Smile
03-14-2012, 12:26 AM #3
Wait this is easy to crack?
03-15-2012, 07:00 PM #4
Nero.
Space Ninja
Originally posted by Ehhx View Post
Wait this is easy to crack?


No its not,
you can not view the php code.... (the php contains the password)
even if they did you have a md5 hash as a password so they would have to crack that also Happy
03-20-2012, 11:42 PM #5
Originally posted by Nero. View Post
No its not,
you can not view the php code.... (the php contains the password)
even if they did you have a md5 hash as a password so they would have to crack that also Happy


How can I use this to block a website so they can't visit any other parts of the website?
03-26-2012, 05:23 AM #6
Chaz
Tremble Underfoot
Good code here Smile

Once I become more proficient in PHP i'll have to give this a go Smile Thanks!
03-26-2012, 09:34 PM #7
My turn :p.
Ill code one right now :p.
    


<?php
$self = basename($_SERVER["PHP_SELF"]);
$username = $_POST['user'];
$password = $_POST['pass'];


if (isset($_POST['login'])){
if($username=='realuser' && $password=='password'Winky Winky{

echo "Login Correct";

}else{

echo "Failed Login";


}
}
?>



<html>
<!--Form, still needs to be configured.-->
<title="Login">
<body>
<form method="post" action="<?=$self?>">
<b>Username</b><input type="text" name="user" value="Username" onClick="this.value=''"><br>
<b>Password:</b><input type="password" name="pass" value=""> <br>
<input type="submit" value="login" name="login">
</form>
</body>
</html>
<!--/>


Doesn't use encryption, just $_POSY[user] && $_POST['pass'] = Variables assigned with values. But your way also works and it safer i guess. :p.
04-03-2012, 05:09 AM #8
This is horrible.... it's not even using a database.

oh, and why not use the md5,md4, or sha1 functions already built in?

There is no point if it's already in the script. this makes no sense....

---------- Post added at 12:09 AM ---------- Previous post was at 12:08 AM ----------

off topic.. did your old username used to be "Austin"?

The following user groaned Jakes625 for this awful post:

Nero.
04-13-2012, 06:25 AM #9
Originally posted by DEVASTATION View Post
This is horrible.... it's not even using a database.

oh, and why not use the md5,md4, or sha1 functions already built in?

There is no point if it's already in the script. this makes no sense....

---------- Post added at 12:09 AM ---------- Previous post was at 12:08 AM ----------

off topic.. did your old username used to be "Austin"?


they both work man, whats the problem?

The following user thanked skinnytor for this useful post:

Nero.
04-22-2012, 04:43 AM #10
very nice, you coded this yourself... nice.
i'm still working on learning php. i want to make something like this.
good work :y:

The following user thanked Darth Maul for this useful post:

Nero.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo