PHP Classes

File: examples/example1.php

Recommend this page to a friend!
  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: 15 years ago
Size: 583 bytes


Class file image Download
// 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))
$query = $_SERVER["REQUEST_URI"];

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

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