Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/example1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of David Ferreira  >  Rex  >  examples/example1.php  >  Download  
File: examples/example1.php
Role: Example script
Content type: text/plain
Description: Example script on how to use Rex class
Class: Rex
Check proxy addresses and filter Javascript
Author: By
Last change: v1.1 update
Date: 6 years ago
Size: 583 bytes
 

Contents

Class file image Download
<?php
// example1 php showing Rex class in action

// ...
require "rex.class.php";
$rex = new rex();

$liga mysql_connect("localhost""user""pass");
mysql_select_db("dbname"$liga);

$id $_GET['id'];

// id not a numeric value?? Rex will log it
if (!is_numeric($id))
{
    
$ip $_SERVER["REMOTE_ADDR"];
    
$query $_SERVER["REQUEST_URI"];

    
$a $rex->recordlog("$ip""Malicious use on : $query");
    
header("Location: whereyouwant.php");
    exit;
}

$sql "SELECT * FROM tblusers WHERE id = '$id'";
$res mysql_query($sql);
// ...


?>