Thursday, March 24, 2011
Make Login systems with Php
Login system is one of the most important part of your website, the existance of your website depends on this log in system. So you must keep your login sytem with secure login security systems. Let see some coding may be can use to protect your system log in more secure.
Look the standard form login below
after that use php to make the session of user login, let see the code below
*server.inc can find in exercise before
Look the standard form login below
Log in
coding for standard form log in<form name="frm login" method="post" action="loginsubmit.php"> <Table> <tr> <td>email</td> <td>: <input type="text" class="field" name="textemail"/></td> </tr> <tr> <td>Password</td> <td>: <input type="password" class="field" name="textpassword"/></td> </tr> <tr> <td> </td> <td> <img src="captcha.php" /></td> </tr> <tr> <td>sekuriti</td> <td>: <input class="field" type="text" name="captcha" maxlength="10" value="" /></td> </tr> </Table> <div align="center"> <input type="submit" class="login-submit" value="Log in" /> </div> </form> |
after that use php to make the session of user login, let see the code below
loginsubmit.php include ("server.inc"); $username = strtolower($_POST['textusername']); $password = $_POST['textpassword']; $result = mysql_query("select ID_user,username,password,kategori from user where username = '$username' and password = '$enkrip_pass'"); if(mysql_num_rows($result) != 0) { $baris = mysql_fetch_row($result); session_start(); $ID=$baris[0]; $username=$baris[1]; $password=$baris[2]; $kategori=$baris[3]; $_SESSION['userID']=$ID; $_SESSION['username']=$username; $_SESSION['password']=$enkrip_password; $_SESSION['kategori']=$kategori; header("location:home.php?view=$ID_konversi"); } ?> |
*server.inc can find in exercise before
This post was written by: Yung Fei
Follow me on My Twitter and like my Online Coupons fans page
- Best Regard -
OnlineCouponz
Fresh Printable Coupons
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment