Login   Register  
PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Saeed Ahmed  >  Simple login and database module  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: sample file
Class: Simple login and database module
Authenticate users with records in a MySQL table
Author: By
Last change: some unwanted code are removed
Date: 4 years ago
Size: 885 bytes
 

Contents

Class file image Download
<?php
/*
 * file name : login.class.php
 * class name : login
 * pupose: for login module, database connectibity, query execution and fetch data from database
 * author : saeed ahmed
 * contact email: saeed.sas@gmail.com
 * website: http://saeed05.wordpress.com
 * License : GPL http://www.gnu.org/licenses/gpl.html
 */

include_once 'login.class.php';

$obj = new Login();

if(isset(
$_GET['val']) && $_GET['val'] == '0') {
    
$obj->logout();
}

if(isset (
$_POST[submit])) {

       
$response $obj->login_user($_POST['username'],$_POST['username']);
}
?>

<form action="sample.php" method="POST">
    username : <input name = "username" type="text" /><br/>
    password : <input name = "password" type ="password" /><br/>
    <input name ="submit" type ="submit" value ="login" />
</form>

<?php if(isset($response)) echo "<h4>" $response "</h4>"?>