Benden
maging ang maganda mamatay
LIVE DEMO:
Username: guest
password: guest
also to see error just type random username and pass
Hello I made this html login page it only takes 3 pages
login.php
checklogin.php
login_succes.php
First login.php
Please note that it is a one picture background (N) Im not good with css you also have to edit the divs to fit your login page
Second the checklogin.php (this is a php code)
There is an error with this that I didnt bother fixing as the code still works with it it just has an error code popup when your login is incorrect
Finally login_success.php
This is your body for when they did login you can rename it yiou'll have to edit the checklogin.php page then\
Also insert a table called members with a username slot and a password slot also a id slot.
Thanks this is my first please some NICE feedback and no saying it sucks
You must be registered for see links
Username: guest
password: guest
also to see error just type random username and pass
Hello I made this html login page it only takes 3 pages
login.php
checklogin.php
login_succes.php
First login.php
HTML:
<title> Page Title</title>
<body background="http://img.sharefast.net/1292283393575221346155.jpg">
<form name="form1" method="post" action="checklogin.php">
<div style="position: absolute; z-index: 1; left: 930; top: 250" id="layer1">
<td colspan="3"><strong>Member Login </strong></td>
</div>
<div style="position: absolute; z-index: 1; left: 850; top: 290" id="layer1">
<td width="78">Email</td>
<td width="6">:</td>
<div style="position: absolute; z-index: 1; left: 100; top: 0" id="layer1">
<td width="294"><input name="myusername" type="text" id="myusername"></td>
</div>
</div>
<div style="position: absolute; z-index: 1; left: 850; top: 330" id="layer1">
<td>Password</td>
<td>:</td>
<div style="position: absolute; z-index: 1; left: 100; top: 0" id="layer1">
<td><input name="mypassword" type="text" id="mypassword"></td>
</div>
</div>
<td> </td>
<td> </td>
<div style="position: absolute; z-index: 1; left: 1055; top: 360" id="layer1">
<td><input type="submit" name="Submit" value="Login"></td>
</div>
</form>
<div style="position: absolute; z-index: 1; left: 850; top: 445" id="layer1">
Havent got an account? <a href="http://www.lifeomg.site40.net/Register.php" target="">get one today!</a>
</div>
Second the checklogin.php (this is a php code)
PHP:
<?php
$host="your host"; // Host name
$username="your username"; // Mysql username
$password="password"; // Mysql password
$db_name="database name"; // Database name
$tbl_name="members"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// username and password sent from form
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:home.php");
}
else {
echo "Wrong Username or Password";
}
?>
Finally login_success.php
PHP:
<?
session_start();
if(!session_is_registered(myusername)){
header("location:main_login.php");
}
?>
<html>
<title> Page title </title>
<body>
Just edit this crap to your needs
</body>
</html>
Also insert a table called members with a username slot and a password slot also a id slot.
Thanks this is my first please some NICE feedback and no saying it sucks