Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php if (!defined('WEB_ROOT')) { echo "You Cannot directly access this pag..
Decoded Output download
<?php if (!defined('WEB_ROOT')) {
echo "You Cannot directly access this page";
exit;
}
if($_SERVER['SERVER_NAME']!="" && str_replace("www.","",$_SERVER['SERVER_NAME'])!="gramhoot.com" && str_replace("beta.","",$_SERVER['SERVER_NAME'])!="localhost")
{ echo "Please purchase new Domain Licence key from Techweblabs.com";
exit;
}
class databaseLayer
{
private $server = "localhost";
private $user = "root";
private $pass = "";
private $database = "liequine";
private $pre = "";
private $record = array();
private $error = "";
private $errno = 0;
private $field_table = "";
private $affected_rows = 0;
private $link_id = 0;
private $query_id = 0;
private $query = "";
private $restype = "";
private $conn = "";
private $out = array();
function __construct($server = "", $user = "", $pass = "", $database = "", $pre = '')
{
if ($server != "") $this->server = $server;
if ($user != "") $this->user = $user;
if ($pass != "") $this->pass = $pass;
if ($database != "") $this->database = $database;
if ($pre != "") $this->pre = $pre;
}
private function connect($new_link = false)
{
$this->link_id = mysqli_connect($this->server, $this->user, $this->pass, $new_link);
if (!$this->link_id) {
$this->oops("Could not connect to server: <b>$this->server</b>.");
}
$d = mysqli_select_db($this->link_id,$this->database);
if (!mysqli_select_db($this->database, $this->link_id)) {
$this->oops("Could not open database: <b>$this->database</b>.");
}
}
private function close()
{
if (!mysqli_close($this->link_id)) {
$this->oops("Connection close failed.");
}
}
private function escape($string)
{
if (get_magic_quotes_gpc()) $string = stripslashes($string);
return mysql_real_escape_string($string);
}
function objSelect($query, $restype = "")
{
$this->out = array();
$this->connect();
$this->restype = $restype;
$this->query_id = mysqli_query( $this->link_id,$query);
if (!$this->query_id) {
$this->oops("<b>mysqli Query fail:</b> $sql");
}
if ($this->restype == "ROWCNT") {
$this->out = mysqli_num_rows($this->query_id);
$this->close();
return $this->out;
} else if ($this->restype == "ROW") {
$this->out = mysqli_fetch_assoc($this->query_id);
if ($this->out) {
$this->out = array_map("stripslashes", $this->out);
}
$this->close();
//var_dump($this->out);exit;
return $this->out;
} else if ($this->restype == "ASSOCIATIVE") {
while ($row = mysqli_fetch_array($this->query_id)) {
$this->out[] = array_map("stripslashes", $row);
}
mysqli_free_result($query_id);
$this->close();
return $this->out;
} else if ($this->restype == "ASSOC") {
while ($row = mysqli_fetch_assoc($this->query_id)) {
$this->out[] = array_map("stripslashes", $row);
}
mysqli_free_result($query_id);
$this->close();
return $this->out;
} else if ($this->restype == "OBJECT") {
while ($row = mysqli_fetch_object($this->query_id)) {
$this->out[] = array_map("stripslashes", $row);
}
mysqli_free_result($query_id);
$this->close();
return $this->out;
} else {
return $this->query_id;
}
}
function objInsert($table = "", $cols = "", $vals = "", $restype = "")
{
$this->connect();
$this->restype = $restype;
$query = "insert into $table ($cols) values ($vals)";
$this->query_id = mysqli_query( $this->link_id,$query);
if (!$this->query_id) {
$this->oops("<b>mysqli Query fail:</b> $sql");
}
switch ($this->restype) {
case "LASTID":
$this->record = mysqli_insert_id($this->link_id);
$this->close();
return $this->record;
break;
default:
$this->close();
return $this->query_id;
}
}
function objUpdate($table = "", $cols = "", $vals = "", $Cond = "", $restype = "")
{
$this->connect();
$colArr = explode(",", $cols);
$valArr = explode("*@@*", $vals);
for ($i = 0; $i < count($colArr); $i++) {
$arr[] = $colArr[$i] . "=" . $valArr[$i];
}
$arrstr = implode(",", $arr);
$this->restype = $restype;
$query = "update $table set $arrstr $Cond";
$this->query_id = mysqli_query( $this->link_id,$query);
if (!$this->query_id) {
$this->oops("<b>mysqli Query fail:</b> $sql");
}
switch ($this->restype) {
case "AFFROWS":
$this->record = mysqli_affected_rows($this->link_id);
$this->close();
return $this->record;
break;
default:
$this->close();
return $this->query_id;
}
}
function objDelete($table = "", $Cond = "", $restype = "")
{
$this->connect();
$this->restype = $restype;
$query = "delete from $table $Cond";
$this->query_id = mysqli_query( $this->link_id,$query);
if (!$this->query_id) {
$this->oops("<b>mysqli Query fail:</b> $sql");
}
switch ($this->restype) {
case "AFFROWS":
$this->record = mysqli_affected_rows($this->link_id);
$this->close();
return $this->record;
break;
default:
$this->close();
return $this->query_id;
}
}
function oops($msg = '')
{
}
}
$db = new databaseLayer(HOST, USER, PASS, DB);
?>
Did this file decode correctly?
Original Code
<?php if (!defined('WEB_ROOT')) {
echo "You Cannot directly access this page";
exit;
}
if($_SERVER['SERVER_NAME']!="" && str_replace("www.","",$_SERVER['SERVER_NAME'])!="gramhoot.com" && str_replace("beta.","",$_SERVER['SERVER_NAME'])!="localhost")
{ echo "Please purchase new Domain Licence key from Techweblabs.com";
exit;
}
class databaseLayer
{
private $server = "localhost";
private $user = "root";
private $pass = "";
private $database = "liequine";
private $pre = "";
private $record = array();
private $error = "";
private $errno = 0;
private $field_table = "";
private $affected_rows = 0;
private $link_id = 0;
private $query_id = 0;
private $query = "";
private $restype = "";
private $conn = "";
private $out = array();
function __construct($server = "", $user = "", $pass = "", $database = "", $pre = '')
{
if ($server != "") $this->server = $server;
if ($user != "") $this->user = $user;
if ($pass != "") $this->pass = $pass;
if ($database != "") $this->database = $database;
if ($pre != "") $this->pre = $pre;
}
private function connect($new_link = false)
{
$this->link_id = mysqli_connect($this->server, $this->user, $this->pass, $new_link);
if (!$this->link_id) {
$this->oops("Could not connect to server: <b>$this->server</b>.");
}
$d = mysqli_select_db($this->link_id,$this->database);
if (!mysqli_select_db($this->database, $this->link_id)) {
$this->oops("Could not open database: <b>$this->database</b>.");
}
}
private function close()
{
if (!mysqli_close($this->link_id)) {
$this->oops("Connection close failed.");
}
}
private function escape($string)
{
if (get_magic_quotes_gpc()) $string = stripslashes($string);
return mysql_real_escape_string($string);
}
function objSelect($query, $restype = "")
{
$this->out = array();
$this->connect();
$this->restype = $restype;
$this->query_id = mysqli_query( $this->link_id,$query);
if (!$this->query_id) {
$this->oops("<b>mysqli Query fail:</b> $sql");
}
if ($this->restype == "ROWCNT") {
$this->out = mysqli_num_rows($this->query_id);
$this->close();
return $this->out;
} else if ($this->restype == "ROW") {
$this->out = mysqli_fetch_assoc($this->query_id);
if ($this->out) {
$this->out = array_map("stripslashes", $this->out);
}
$this->close();
//var_dump($this->out);exit;
return $this->out;
} else if ($this->restype == "ASSOCIATIVE") {
while ($row = mysqli_fetch_array($this->query_id)) {
$this->out[] = array_map("stripslashes", $row);
}
mysqli_free_result($query_id);
$this->close();
return $this->out;
} else if ($this->restype == "ASSOC") {
while ($row = mysqli_fetch_assoc($this->query_id)) {
$this->out[] = array_map("stripslashes", $row);
}
mysqli_free_result($query_id);
$this->close();
return $this->out;
} else if ($this->restype == "OBJECT") {
while ($row = mysqli_fetch_object($this->query_id)) {
$this->out[] = array_map("stripslashes", $row);
}
mysqli_free_result($query_id);
$this->close();
return $this->out;
} else {
return $this->query_id;
}
}
function objInsert($table = "", $cols = "", $vals = "", $restype = "")
{
$this->connect();
$this->restype = $restype;
$query = "insert into $table ($cols) values ($vals)";
$this->query_id = mysqli_query( $this->link_id,$query);
if (!$this->query_id) {
$this->oops("<b>mysqli Query fail:</b> $sql");
}
switch ($this->restype) {
case "LASTID":
$this->record = mysqli_insert_id($this->link_id);
$this->close();
return $this->record;
break;
default:
$this->close();
return $this->query_id;
}
}
function objUpdate($table = "", $cols = "", $vals = "", $Cond = "", $restype = "")
{
$this->connect();
$colArr = explode(",", $cols);
$valArr = explode("*@@*", $vals);
for ($i = 0; $i < count($colArr); $i++) {
$arr[] = $colArr[$i] . "=" . $valArr[$i];
}
$arrstr = implode(",", $arr);
$this->restype = $restype;
$query = "update $table set $arrstr $Cond";
$this->query_id = mysqli_query( $this->link_id,$query);
if (!$this->query_id) {
$this->oops("<b>mysqli Query fail:</b> $sql");
}
switch ($this->restype) {
case "AFFROWS":
$this->record = mysqli_affected_rows($this->link_id);
$this->close();
return $this->record;
break;
default:
$this->close();
return $this->query_id;
}
}
function objDelete($table = "", $Cond = "", $restype = "")
{
$this->connect();
$this->restype = $restype;
$query = "delete from $table $Cond";
$this->query_id = mysqli_query( $this->link_id,$query);
if (!$this->query_id) {
$this->oops("<b>mysqli Query fail:</b> $sql");
}
switch ($this->restype) {
case "AFFROWS":
$this->record = mysqli_affected_rows($this->link_id);
$this->close();
return $this->record;
break;
default:
$this->close();
return $this->query_id;
}
}
function oops($msg = '')
{
}
}
$db = new databaseLayer(HOST, USER, PASS, DB);
?>
Function Calls
defined | 1 |
Stats
MD5 | 1538d9554e2e67097b296534ce966922 |
Eval Count | 0 |
Decode Time | 121 ms |