4. Source codes
4.1. Login. Php
<?php
include("includes/header.php");
?>
<div id="content">
<section>
<h1>Please login with your credentials</h1>
<span class='required'>*</span>This is a required
field
<form action='validate_login.php' method="POST">
<label for="usernname">Username:</label>
<input name="username" class="username" required size=30
placeholder='Masterpro' type="text"/> *
</br></br>
<label for="password">Password:</label>
<input name="password" class="password" required size=30
type="password"/> *
</br>
<input type="submit" value="Login" name="submit"/>
</form>
</section>
</div>
<hr>
<footer>
Copyright, JKUAT 2014 KENYA. All rights reserved.
</footer>
</body>
</html>
4.2. Db.php
<?php
/* Database config */
$db_host= 'localhost';
$db_user= 'root';
$db_pass= '';
$db_database = 'network';
/* End config */
$db = new PDO('mysql:host='.$db_host.';dbname='.$db_database,
$db_user, $db_pass);
$db->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
?>
|