Wednesday 7 January 2015

Contoh script login dengan php

session01.php
<?php
session_start();
if (isset ($_POST['Login'])) {
     $user = $_POST['user'];
     $pass = $_POST['pass'];
     //periksa login
     if ($user == "aulia" && $pass = "123")
                 {
        echo"<h2>login Berhasil </h2>";
                 }
                 else if ($user == "" && $pass = "")
     {
         echo"<h2>login Gagal </h2>";
                 }
                 else
                 {
         echo"<h2>login Gagal </h2>";
     }
 }
?>
<html>
    <head>
        <title>Login Area</title>
    </head>
    <body>
        <h1>Login Area</h1>
        <form action="biodata.html" method="POST">
        Username<br />
        <input type="text" name="username" /><br />
        Password<br />
        <input type="password" name="password" /><br /><br />
        <input type="submit" value="Login" />
        <p>Klik <a href='session02.php'>di sini </a>untuk menuju ke halaman pemeriksaan </p>
        </form>
    </body>
</html>
<?php
?>


Download script Link1 / Link2








No comments:

Post a Comment