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 goto hJDxL; qzzaO: if ($start < 0) { $start = 0; } goto C7Ucb; e9v1G: if ($pos !==..
Decoded Output download
<?php
goto hJDxL; qzzaO: if ($start < 0) { $start = 0; } goto C7Ucb; e9v1G: if ($pos !== false) { $sqlWhere = substr_replace($sqlWhere, '', $pos, strlen("OR ")); } goto eS8NQ; J0g90: switch ($data_type) { case "xml": $data = "<?xml version='1.0' encoding='utf-8'?>"; $data .= "<rows>"; $data .= "<page>" . $page . "</page>"; $data .= "<total>" . $total_pages . "</total>"; $data .= "<records>" . $count . "</records>"; while ($row = $db->fetch_array_assoc($result)) { $data .= "<row id='" . gen_rowids($row, $sql_key) . "'>"; for ($i = 0; $i < $db->num_fields($result); $i++) { $col_name = $db->field_name($result, $i); $data .= "<cell>" . $row[$col_name] . "</cell>"; } $data .= "</row>"; } $data .= "</rows>"; header("Content-type: text/xml;charset=utf-8"); echo $data; break; case "json": $response = new stdClass(); $response->page = $page; $response->total = $total_pages; $response->records = $count; $i = 0; $data = array(); while ($row = $db->fetch_array_assoc($result)) { unset($data); $response->rows[$i]["id"] = C_Utility::gen_rowids($row, $sql_key); for ($j = 0; $j < $db->num_fields($result); $j++) { $col_name = $db->field_name($result, $j); $data[] = $row[$col_name]; } $response->rows[$i]["cell"] = $data; $data = array(); $i++; } echo json_encode($response); break; } goto J3hrx; q7iq6: if (empty($cn)) { $db = new C_DataBase(PHPGRID_DB_HOSTNAME, PHPGRID_DB_USERNAME, PHPGRID_DB_PASSWORD, PHPGRID_DB_NAME, PHPGRID_DB_TYPE, PHPGRID_DB_CHARSET); } else { $db = new C_DataBase($cn["hostname"], $cn["username"], $cn["password"], $cn["dbname"], $cn["dbtype"], $cn["dbcharset"]); } goto TElaM; kUKob: $sord = $_GET["sord"]; goto xMsD8; WuY_U: $cn = $db_connection; goto q7iq6; gM1hQ: $gridName = isset($_GET["gn"]) ? $_GET["gn"] : die("PHPGRID_ERROR: ULR parameter "gn" is not defined."); goto bmTSO; xMsD8: $rs = $db->select_limit($grid_sql, 1, 0); goto cNhMv; y7O15: $sql_fkey = $_SESSION[GRID_SESSION_KEY . "_" . $gridName . "_sql_fkey"]; goto tsiI4; J3hrx: $db = null; goto zwd_h; Gs2yb: if ($count > 0 && $limit > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } goto TlrpU; cNhMv: $sqlWhere = ''; goto sCXrS; x6shm: $sql_key = unserialize($_SESSION[GRID_SESSION_KEY . "_" . $gridName . "_sql_key"]); goto y7O15; EnPsb: if (!session_id()) { session_start(); } goto gM1hQ; x6XYu: $grid_sql = $_SESSION[GRID_SESSION_KEY . "_" . $gridName . "_sql"]; goto x6shm; jPm9h: $db_connection = unserialize($_SESSION[GRID_SESSION_KEY . "_" . $gridName . "_db_connection"]); goto WuY_U; C7Ucb: $db->db->SetFetchMode(ADODB_FETCH_BOTH); goto x_v0g; bmTSO: $data_type = isset($_GET["dt"]) ? $_GET["dt"] : "json"; goto x6XYu; Lhl0o: $start = $limit * $page - $limit; goto qzzaO; O85HE: if ($sql_filter != '' && $searchOn) { $SQL = $grid_sql . " WHERE " . $sql_filter . " AND " . $sqlWhere . $sqlOrderBy; } elseif ($sql_filter != '' && !$searchOn) { $SQL = $grid_sql . " WHERE " . $sql_filter . $sqlOrderBy; } elseif ($sql_filter == '' && $searchOn) { $SQL = $grid_sql . " WHERE " . $sqlWhere . $sqlOrderBy; } else { $SQL = $grid_sql . $sqlOrderBy; } goto Lhl0o; p8W78: $sql_filter = $_SESSION[GRID_SESSION_KEY . "_" . $gridName . "_sql_filter"]; goto jPm9h; TlrpU: if ($page > $total_pages) { $page = $total_pages; } goto J0g90; A3gV_: if ($pos !== false) { $sqlWhere = substr_replace($sqlWhere, '', $pos, strlen("AND ")); } goto lk9hC; p0z7b: $pos = strpos($sqlWhere, "AND "); goto A3gV_; eS8NQ: $sqlOrderBy = !$sidx ? '' : " ORDER BY {$sidx} {$sord}"; goto O85HE; sCXrS: $searchOn = isset($_REQUEST["_search"]) && $_REQUEST["_search"] == "true" ? true : false; goto HppoR; A8Xzm: $sidx = $_GET["sidx"]; goto kUKob; hJDxL: require_once "phpGrid.php"; goto EnPsb; lk9hC: $pos = strpos($sqlWhere, "OR "); goto e9v1G; UNqtF: $count = $db->num_rows($db->db_query($SQL)); goto Gs2yb; HppoR: if ($searchOn) { $col_dbnames = array(); $col_dbnames = $db->get_col_dbnames($rs); foreach ($_REQUEST as $key => $value) { if (in_array($key, $col_dbnames)) { $fm_type = $db->field_metatype($rs, $db->field_index($rs, $key)); switch ($fm_type) { case "I": case "N": case "R": case "SERIAL": case "L": $sqlWhere .= " AND " . $key . " = " . $value; break; default: $sqlWhere .= " AND " . $key . " LIKE '" . $value . "%'"; break; } } } if (isset($_REQUEST["filters"]) && $_REQUEST["filters"] != '') { $op = array("eq" => " ='%s' ", "ne" => " !='%s' ", "lt" => " < %s ", "le" => " <= %s ", "gt" => " > %s ", "ge" => " >= %s ", "bw" => " like '%s%%' ", "bn" => " not like '%s%%' ", "in" => " in (%s) ", "ni" => " not in (%s) ", "ew" => " like '%%%s' ", "en" => " not like '%%%s' ", "cn" => " like '%%%s%%' ", "nc" => " not like '%%%s%%' "); $filters = json_decode(stripcslashes($_REQUEST["filters"])); $groupOp = $filters->groupOp; $rules = $filters->rules; for ($i = 0; $i < count($rules); $i++) { $sqlWhere .= $groupOp . " " . $rules[$i]->field . sprintf($op[$rules[$i]->op], $rules[$i]->data); } } } goto p0z7b; tsiI4: $sql_table = $_SESSION[GRID_SESSION_KEY . "_" . $gridName . "_sql_table"]; goto p8W78; x_v0g: $result = $db->select_limit($SQL, $limit, $start); goto UNqtF; s_QQ9: $limit = $_GET["rows"]; goto A8Xzm; TElaM: $page = $_GET["page"]; goto s_QQ9; zwd_h: ?>
Did this file decode correctly?
Original Code
<?php
goto hJDxL; qzzaO: if ($start < 0) { $start = 0; } goto C7Ucb; e9v1G: if ($pos !== false) { $sqlWhere = substr_replace($sqlWhere, '', $pos, strlen("\x4f\x52\x20")); } goto eS8NQ; J0g90: switch ($data_type) { case "\x78\x6d\x6c": $data = "\x3c\x3f\170\x6d\x6c\x20\166\145\162\x73\x69\157\156\x3d\47\x31\x2e\x30\x27\40\x65\156\143\x6f\144\151\156\147\75\x27\x75\x74\146\x2d\70\x27\x3f\x3e"; $data .= "\74\162\x6f\167\x73\76"; $data .= "\74\x70\x61\147\145\76" . $page . "\x3c\x2f\160\141\x67\145\76"; $data .= "\x3c\x74\x6f\x74\141\154\76" . $total_pages . "\x3c\x2f\x74\157\164\x61\x6c\76"; $data .= "\74\x72\145\143\157\162\144\x73\76" . $count . "\74\x2f\162\x65\x63\157\x72\x64\163\76"; while ($row = $db->fetch_array_assoc($result)) { $data .= "\74\x72\157\x77\40\151\144\75\47" . gen_rowids($row, $sql_key) . "\x27\x3e"; for ($i = 0; $i < $db->num_fields($result); $i++) { $col_name = $db->field_name($result, $i); $data .= "\74\x63\x65\x6c\x6c\76" . $row[$col_name] . "\74\x2f\x63\145\154\154\76"; } $data .= "\74\x2f\162\157\x77\76"; } $data .= "\74\57\162\x6f\167\163\76"; header("\103\157\x6e\164\x65\x6e\164\55\x74\171\x70\x65\72\x20\164\x65\x78\x74\57\170\155\154\x3b\x63\x68\x61\x72\163\145\164\x3d\x75\x74\x66\55\x38"); echo $data; break; case "\152\x73\x6f\x6e": $response = new stdClass(); $response->page = $page; $response->total = $total_pages; $response->records = $count; $i = 0; $data = array(); while ($row = $db->fetch_array_assoc($result)) { unset($data); $response->rows[$i]["\151\144"] = C_Utility::gen_rowids($row, $sql_key); for ($j = 0; $j < $db->num_fields($result); $j++) { $col_name = $db->field_name($result, $j); $data[] = $row[$col_name]; } $response->rows[$i]["\143\x65\154\x6c"] = $data; $data = array(); $i++; } echo json_encode($response); break; } goto J3hrx; q7iq6: if (empty($cn)) { $db = new C_DataBase(PHPGRID_DB_HOSTNAME, PHPGRID_DB_USERNAME, PHPGRID_DB_PASSWORD, PHPGRID_DB_NAME, PHPGRID_DB_TYPE, PHPGRID_DB_CHARSET); } else { $db = new C_DataBase($cn["\x68\x6f\x73\x74\x6e\141\155\x65"], $cn["\165\x73\145\x72\x6e\x61\155\x65"], $cn["\160\x61\x73\x73\x77\x6f\x72\144"], $cn["\x64\142\x6e\141\155\x65"], $cn["\144\142\164\171\160\x65"], $cn["\144\142\x63\x68\x61\162\x73\145\x74"]); } goto TElaM; kUKob: $sord = $_GET["\x73\157\x72\144"]; goto xMsD8; WuY_U: $cn = $db_connection; goto q7iq6; gM1hQ: $gridName = isset($_GET["\x67\156"]) ? $_GET["\x67\156"] : die("\x50\110\120\x47\122\x49\x44\137\105\x52\x52\x4f\x52\72\40\x55\x4c\122\40\160\x61\x72\141\155\x65\x74\145\x72\40\42\147\156\x22\x20\x69\163\40\156\x6f\164\40\x64\145\146\151\x6e\x65\x64\x2e"); goto bmTSO; xMsD8: $rs = $db->select_limit($grid_sql, 1, 0); goto cNhMv; y7O15: $sql_fkey = $_SESSION[GRID_SESSION_KEY . "\137" . $gridName . "\x5f\x73\161\154\x5f\146\153\x65\171"]; goto tsiI4; J3hrx: $db = null; goto zwd_h; Gs2yb: if ($count > 0 && $limit > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } goto TlrpU; cNhMv: $sqlWhere = ''; goto sCXrS; x6shm: $sql_key = unserialize($_SESSION[GRID_SESSION_KEY . "\x5f" . $gridName . "\x5f\163\161\x6c\137\x6b\x65\x79"]); goto y7O15; EnPsb: if (!session_id()) { session_start(); } goto gM1hQ; x6XYu: $grid_sql = $_SESSION[GRID_SESSION_KEY . "\x5f" . $gridName . "\x5f\163\161\x6c"]; goto x6shm; jPm9h: $db_connection = unserialize($_SESSION[GRID_SESSION_KEY . "\137" . $gridName . "\x5f\144\142\137\x63\x6f\156\x6e\145\x63\164\151\157\x6e"]); goto WuY_U; C7Ucb: $db->db->SetFetchMode(ADODB_FETCH_BOTH); goto x_v0g; bmTSO: $data_type = isset($_GET["\144\164"]) ? $_GET["\144\x74"] : "\152\x73\157\x6e"; goto x6XYu; Lhl0o: $start = $limit * $page - $limit; goto qzzaO; O85HE: if ($sql_filter != '' && $searchOn) { $SQL = $grid_sql . "\x20\127\x48\x45\122\105\x20" . $sql_filter . "\x20\x41\116\104\40" . $sqlWhere . $sqlOrderBy; } elseif ($sql_filter != '' && !$searchOn) { $SQL = $grid_sql . "\40\127\x48\105\x52\x45\x20" . $sql_filter . $sqlOrderBy; } elseif ($sql_filter == '' && $searchOn) { $SQL = $grid_sql . "\40\127\x48\105\122\x45\x20" . $sqlWhere . $sqlOrderBy; } else { $SQL = $grid_sql . $sqlOrderBy; } goto Lhl0o; p8W78: $sql_filter = $_SESSION[GRID_SESSION_KEY . "\x5f" . $gridName . "\137\163\x71\154\137\146\151\x6c\164\145\x72"]; goto jPm9h; TlrpU: if ($page > $total_pages) { $page = $total_pages; } goto J0g90; A3gV_: if ($pos !== false) { $sqlWhere = substr_replace($sqlWhere, '', $pos, strlen("\x41\x4e\104\x20")); } goto lk9hC; p0z7b: $pos = strpos($sqlWhere, "\101\116\x44\40"); goto A3gV_; eS8NQ: $sqlOrderBy = !$sidx ? '' : "\40\x4f\x52\104\x45\x52\40\102\x59\40{$sidx}\40{$sord}"; goto O85HE; sCXrS: $searchOn = isset($_REQUEST["\x5f\x73\145\x61\162\x63\x68"]) && $_REQUEST["\x5f\x73\x65\x61\162\x63\x68"] == "\164\x72\165\x65" ? true : false; goto HppoR; A8Xzm: $sidx = $_GET["\163\x69\144\170"]; goto kUKob; hJDxL: require_once "\160\x68\160\107\x72\151\144\56\x70\x68\x70"; goto EnPsb; lk9hC: $pos = strpos($sqlWhere, "\117\x52\x20"); goto e9v1G; UNqtF: $count = $db->num_rows($db->db_query($SQL)); goto Gs2yb; HppoR: if ($searchOn) { $col_dbnames = array(); $col_dbnames = $db->get_col_dbnames($rs); foreach ($_REQUEST as $key => $value) { if (in_array($key, $col_dbnames)) { $fm_type = $db->field_metatype($rs, $db->field_index($rs, $key)); switch ($fm_type) { case "\x49": case "\116": case "\122": case "\x53\x45\x52\x49\101\114": case "\x4c": $sqlWhere .= "\x20\x41\116\x44\x20" . $key . "\x20\x3d\40" . $value; break; default: $sqlWhere .= "\40\101\x4e\104\x20" . $key . "\x20\114\x49\113\105\x20\47" . $value . "\45\x27"; break; } } } if (isset($_REQUEST["\146\x69\x6c\164\x65\162\163"]) && $_REQUEST["\x66\151\x6c\x74\145\x72\163"] != '') { $op = array("\x65\161" => "\x20\x3d\x27\45\163\47\x20", "\156\145" => "\x20\41\75\x27\45\163\x27\x20", "\x6c\x74" => "\40\x3c\40\x25\x73\40", "\154\x65" => "\x20\x3c\75\40\45\x73\x20", "\147\164" => "\x20\x3e\40\45\163\x20", "\x67\145" => "\40\76\x3d\x20\45\x73\40", "\x62\x77" => "\x20\154\151\153\x65\x20\47\x25\163\45\45\47\40", "\x62\x6e" => "\40\156\x6f\x74\x20\154\151\x6b\145\x20\x27\x25\x73\x25\x25\x27\x20", "\x69\x6e" => "\x20\x69\156\40\50\45\163\x29\x20", "\156\x69" => "\x20\x6e\x6f\x74\40\x69\156\40\50\x25\163\x29\x20", "\x65\x77" => "\x20\x6c\x69\x6b\x65\x20\47\x25\45\45\163\47\40", "\x65\156" => "\x20\156\x6f\164\40\x6c\151\x6b\x65\40\47\45\45\45\x73\x27\x20", "\x63\x6e" => "\40\x6c\151\153\x65\40\x27\x25\45\x25\x73\x25\x25\x27\40", "\156\x63" => "\40\x6e\157\164\x20\x6c\151\153\x65\40\x27\45\45\x25\x73\x25\45\47\x20"); $filters = json_decode(stripcslashes($_REQUEST["\x66\x69\154\x74\x65\162\x73"])); $groupOp = $filters->groupOp; $rules = $filters->rules; for ($i = 0; $i < count($rules); $i++) { $sqlWhere .= $groupOp . "\x20" . $rules[$i]->field . sprintf($op[$rules[$i]->op], $rules[$i]->data); } } } goto p0z7b; tsiI4: $sql_table = $_SESSION[GRID_SESSION_KEY . "\137" . $gridName . "\x5f\x73\x71\x6c\x5f\164\x61\142\154\145"]; goto p8W78; x_v0g: $result = $db->select_limit($SQL, $limit, $start); goto UNqtF; s_QQ9: $limit = $_GET["\162\157\x77\163"]; goto A8Xzm; TElaM: $page = $_GET["\160\x61\x67\145"]; goto s_QQ9; zwd_h: ?>
Function Calls
None |
Stats
MD5 | 107f16bd9138c78e364b8d099af1a140 |
Eval Count | 0 |
Decode Time | 44 ms |