PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Amr Alaa   login class by AmRaLaA   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: test file
Class: login class by AmRaLaA
Authenticate users with records in a MySQL table
Author: By
Last change:
Date: 13 years ago
Size: 805 bytes
 

Contents

Class file image Download
<?php
$con
= @mysql_connect("localhost","root","");
$db = @mysql_select_db("amr",$con);
include(
'class.php');



$Amr = new login_Amr;
$Amr->SESSION_NAME = 'test';
$Amr->table = 'admin';
$Amr->Grade_name = 'username';
$Amr->Grade_pass = 'password';

if(empty(
$_GET)){
echo
$Amr->free("<center>welcome ".$Amr->name().'<br><a href="?logoff">تسجيل الخروج</a>','<form method="POST" action="?login">
    <p><input type="text" name="name" size="20">&nbsp;
    <input type="text" name="pass" size="20">&nbsp;
    <input type="submit" value="إرسال" name="B1"><input type="reset" value="إعادة تعيين" name="B2"></p>
</form>'
);
}elseif(isset(
$_GET['login'])){
if(isset(
$_POST['name'])){
echo
$Amr->login(1,$_POST['name'],$_POST['pass']);
}
}elseif(isset(
$_GET['logoff'])){
echo
$Amr->logoff();
}

?>