Very Very Simple login script

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

Eric

VIP Member
Impact
328
This is a very simple login script.

The Form
Code:
<html>
<body>

<form name="form" method="post" action="login.php">
Username: <br>
<input type="text" title="Username" name="Username"><br>
Password: <br>
<input type="password" title="Password" name="Password"><br>
<input type="submit" name="Submit" value="Login">

</form>
</body>
</html>

login.php
PHP:
<?php
/************************
Very Simple Login v1.0
Copyright (c) SecondVersion
************************/
$username = 'username';
$password = 'password';

if($_POST['Password'] == $password || $_POST['Username']== $username) {

header('Location: http://www.yourdomain.com/path/to/membersarea');
}
else {
  print('Wrong username or password. <a href="javascript:history.go(-1)">Please try again.');
}

?>
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Grat one! B-)
 
0
Close
Thanks lol... Told ya.. very very, well.. very very very very simple :lol:
 
0
Close
Very Very Very Very Simple :). When are you going to release the simple log in script, and the not so simple one :lol:
 
0
Close
i am looking for a login script which can be placed on main page of my site and would login the users on the forums also. You got one of those in ur pockets?
 
0
Close
So simple I even said grat instead of great :o oops ;)
 
0
Close
Indeed, very simple.. :)
Thanks for writing!
 
0
Close
This really works!
 
0
Close
its simple. havent tried it yet. but howd you secure the members area ? :P
 
0
Close
nice and easy yes but not very secure

i would try to encorporate some kind of encryption on those passwords.
 
0
Close
This method only has one user id and pw, rather than individual ones for each member. Since it's not very secure, why not simply use a secure folder, created from your control panel or .htaccess?
 
0
Close
Yes, it is not secure. And only allows one id and pass.. Like I said, very very very simple ;) I'll get into everything else later...
 
0
Close
killerid said:
i am looking for a login script which can be placed on main page of my site and would login the users on the forums also. You got one of those in ur pockets?


what forum software are you using?
 
0
Close
0
Close
0
Close
Code:
<?
$user1 = "user1";
$pass1 = "pass1";
$user2 = "user2";
$pass2 = "pass2";
if ($user == $user1&&$pw == $pass1)
{
   header("Location: http://website.com/area/user1");
}
if ($user == $user2&&$pw == $pass2)
{
   header("Location: http://website.com/area/user2");
}

  else
{
   print("Wrong username or password. Please try again.");
}
?>

Just keep adding users and if statements
 
0
Close
... or use MySQL <_<
 
0
Close
if i knew how to input users and passwords :)
 
0
Close
$query = "INSERT INTO tablename VALUES('$username', '$password')";
mysql_query($query);

that's a very simple input thing for ya - you'll need to put the stuff in VALUES() in order of the columns of the table...
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
CryptoExchange.com
Domain Recover

NamePros updates

Quick replies: search, your most used replies, and more on every post
Quick replies are easier to find and use now. The quick reply menu has a search box. Type a few letters to find the reply you want. A...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back