Exemplo n.º 1
0
}
///////////////////////////////////////// DEFINITIONS
$remote = $_SERVER["REMOTE_ADDR"];
if (!empty($ACCEPTIP)) {
    if ($remote != '127.0.0.1' && $remote != $ACCEPTIP) {
        err("Unauthorised client: '{$remote}'");
    }
}
if (empty($_REQUEST['sql'])) {
    err('No SQL');
}
$conn =& ADONewConnection($driver);
if (!$conn->Connect($host, $uid, $pwd, $database)) {
    err($conn->ErrorNo() . $sep . $conn->ErrorMsg());
}
$sql = undomq($_REQUEST['sql']);
if (isset($_REQUEST['fetch'])) {
    $ADODB_FETCH_MODE = $_REQUEST['fetch'];
}
if (isset($_REQUEST['nrows'])) {
    $nrows = $_REQUEST['nrows'];
    $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : -1;
    $rs = $conn->SelectLimit($sql, $nrows, $offset);
} else {
    $rs = $conn->Execute($sql);
}
if ($rs) {
    //$rs->timeToLive = 1;
    echo _rs2serialize($rs, $conn, $sql);
    $rs->Close();
} else {
Exemplo n.º 2
0
}
///////////////////////////////////////// DEFINITIONS
$remote = $HTTP_SERVER_VARS["REMOTE_ADDR"];
if (empty($HTTP_GET_VARS['sql'])) {
    err('No SQL');
}
if (!empty($ACCEPTIP)) {
    if ($remote != '127.0.0.1' && $remote != $ACCEPTIP) {
        err("Unauthorised client: '{$remote}'");
    }
}
$conn =& ADONewConnection($driver);
if (!$conn->Connect($host, $uid, $pwd, $database)) {
    err($conn->ErrorNo() . $sep . $conn->ErrorMsg());
}
$sql = undomq($HTTP_GET_VARS['sql']);
if (isset($HTTP_GET_VARS['fetch'])) {
    $ADODB_FETCH_MODE = $HTTP_GET_VARS['fetch'];
}
if (isset($HTTP_GET_VARS['nrows'])) {
    $nrows = $HTTP_GET_VARS['nrows'];
    $offset = isset($HTTP_GET_VARS['offset']) ? $HTTP_GET_VARS['offset'] : -1;
    $rs = $conn->SelectLimit($sql, $nrows, $offset);
} else {
    $rs = $conn->Execute($sql);
}
if ($rs) {
    //$rs->timeToLive = 1;
    echo _rs2serialize($rs, $conn, $sql);
    $rs->Close();
} else {
Exemplo n.º 3
0
}
///////////////////////////////////////// DEFINITIONS
$remote = $_SERVER["REMOTE_ADDR"];
if (empty($_GET['sql'])) {
    err('No SQL');
}
if (!empty($ACCEPTIP)) {
    if ($remote != '127.0.0.1' && $remote != $ACCEPTIP) {
        err("Unauthorised client: '{$remote}'");
    }
}
$conn =& ADONewConnection($driver);
if (!$conn->Connect($host, $uid, $pwd, $database)) {
    err($conn->ErrorNo() . $sep . $conn->ErrorMsg());
}
$sql = undomq($_GET['sql']);
if (isset($_GET['fetch'])) {
    $ADODB_FETCH_MODE = $_GET['fetch'];
}
if (isset($_GET['nrows'])) {
    $nrows = $_GET['nrows'];
    $offset = isset($_GET['offset']) ? $_GET['offset'] : -1;
    $rs = $conn->SelectLimit($sql, $nrows, $offset);
} else {
    $rs = $conn->Execute($sql);
}
if ($rs) {
    //$rs->timeToLive = 1;
    echo _rs2serialize($rs, $conn, $sql);
    $rs->Close();
} else {
Exemplo n.º 4
0
}
///////////////////////////////////////// DEFINITIONS
$remote = $_SERVER["REMOTE_ADDR"];
if (!empty($ACCEPTIP)) {
    if ($remote != '127.0.0.1' && $remote != $ACCEPTIP) {
        err("Unauthorised client: '{$remote}'");
    }
}
if (empty($_REQUEST['sql'])) {
    err('No SQL');
}
$conn =& ADONewConnection($driver);
if (!$conn->Connect($host, $uid, $pwd, $database)) {
    err($conn->ErrorNo() . $sep . $conn->ErrorMsg());
}
$sql = htmlspecialchars(undomq($_REQUEST['sql']), ENT_QUOTES);
if (isset($_REQUEST['fetch'])) {
    $ADODB_FETCH_MODE = $_REQUEST['fetch'];
}
if (isset($_REQUEST['nrows'])) {
    $nrows = $_REQUEST['nrows'];
    $offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : -1;
    $rs = $conn->SelectLimit($sql, $nrows, $offset);
} else {
    $rs = $conn->Execute($sql);
}
if ($rs) {
    //$rs->timeToLive = 1;
    echo _rs2serialize($rs, $conn, $sql);
    $rs->Close();
} else {
Exemplo n.º 5
0
Arquivo: sql.php Projeto: qoire/portal
<?php

/**
* (c) 2000, 2001 Remistech Sdn Bhd. All Rights Reserved.
*  Developed by John Lim
*  Licensed to Natsoft (M) Sdn Bhd to distribute and support. Refer to LICENSE document.
*/
include "./init.php";
include ADODB_DIR . "/tohtml.inc.php";
error_reporting(63);
$sql = isset($HTTP_GET_VARS['sql']) ? $HTTP_GET_VARS['sql'] : '';
$sql = undomq($sql);
?>
<html>

<head>
<title></title>
</head>
 <SCRIPT>
function fetchdb()
{
	var at=document.getdriver.drivers.selectedIndex;
	var dr = document.getdriver.drivers.options[at].text;
	window.location.href = 'sql.php?driver='+escape(dr)+'&rnd='+Math.random()
}

</SCRIPT>
<body bgcolor=white>

<FORM name=getdriver> <b>Database</b> 
	<?php