Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PHP] Very Basic Login Page
#1
[Image: YzwzC.png]

As the title says this is extremely simple, not secure and is just 5 minutes worth of code. Didn't take long at all, just thought I'd share it.
  • Can't leave it blank
  • Must enter right username and password
  • Tweak it all you like.


PHP Code:
<html>
<
head>
<
title>Form</title>
</
head>
<
center>
<
body>
<?
php
/*
Snippit Made By BreShiE
SF Coders
*/

// Tells If The Button Is Pressed
If (isset($_POST["button"])){

//Username and Password variables
$user "breshie";
$pass "yourpass";

// Checks To See If The Text Boxes Are Empty
If ($_POST["text"] == "" || $_POST["pass"] == ""){
    echo 
'<script>alert("Please enter something into the text boxes!")</script>';
    }else{
    
// Checks to see if it's the right details or not
If ($_POST["text"] == $user && $_POST["pass"] == $pass){
echo 
'Correct User!!';
}else{
echo 
'Incorrect!';
}
}
}
?>
<form action="first.php" method="POST">
Username:
<br /><input type="text" name="text">
<br />
<br />
Password:
<br />
<input type="password" name="pass">
<br />
<input type="submit" name="button" value"Click Me">
</form>
</body>
</html> 

http://xblforums.net/work
Reply


Messages In This Thread
[PHP] Very Basic Login Page - by BreShiE - 12-01-2011, 11:45 AM
RE: [PHP] Very Basic Login Page - by SuhinderG - 12-01-2011, 03:33 PM
RE: [PHP] Very Basic Login Page - by D3xus - 12-01-2011, 03:34 PM
RE: [PHP] Very Basic Login Page - by BreShiE - 12-02-2011, 09:32 AM
RE: [PHP] Very Basic Login Page - by D3xus - 12-02-2011, 10:09 AM
RE: [PHP] Very Basic Login Page - by BreShiE - 12-03-2011, 10:53 AM
RE: [PHP] Very Basic Login Page - by D3xus - 12-03-2011, 06:25 PM
RE: [PHP] Very Basic Login Page - by HF~Legend - 12-04-2011, 12:13 PM
RE: [PHP] Very Basic Login Page - by BreShiE - 12-05-2011, 05:30 AM
RE: [PHP] Very Basic Login Page - by Hex - 12-05-2011, 01:44 PM
RE: [PHP] Very Basic Login Page - by Retribute - 06-07-2012, 07:47 PM
RE: [PHP] Very Basic Login Page - by Haxalot - 06-21-2012, 02:34 PM
RE: [PHP] Very Basic Login Page - by Rwkeith - 08-09-2012, 10:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 786 07-27-2020, 11:26 PM
Last Post: tk-hassan
  [help] Improve login script Montana" 1 1,545 03-18-2013, 12:59 PM
Last Post: Haxalot
  Don't need to login Strafeness 5 1,807 01-21-2012, 08:28 AM
Last Post: AceInfinity
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,304 10-10-2011, 01:00 PM
Last Post: Greyersting
  PHP error on page submit kaosjon 7 2,171 09-18-2011, 03:31 AM
Last Post: AceInfinity

Forum Jump:


Users browsing this thread: 2 Guest(s)