PHP实现多存储过程调用

//index.php

br /> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<?php
//告诉浏览器此页面的过期时间(用格林威治时间表示),只要是已经过去的日期即可。
//header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
//告诉浏览器此页面的最后更新日期(用格林威治时间表示)也就是当天,目的就是强迫浏览器获取最新资料
//header("Last-Modified: ".gmdate("D, d M Y H:i:s")."GMT");
//告诉客户端浏览器不使用缓存
//header("Cache-Control: no-cache, must-revalidate");
//参数(与以前的服务器兼容),即兼容HTTP1.0协议
//header("Pragma: no-cache");
//输出MIME类型
//header("Content-type: text/html; charset=gb2312");
//文件长度
//header("Content-Length: 227685");
//接受的范围单位
//header("Accept-Ranges: bytes");
//缺省时文件保存对话框中的文件名称
//header("Content-Disposition:attachment; filename=$filename");
?>
PHP实现多存储过程调用

// Function that calls the PHP script:
function sendRequest(pname) {
// Call the script.
// Use the GET method.
// Pass the email address in the URL.
req.open('post','handle.php?proc='+pname,false);
req.onreadystatechange = handleResponse;
req.send(null);
}

// Function handles the response from the PHP script.
function handleResponse() {
// If everything's okay:
if(req.readyState == 4){
// Assign the returned value to the document object.
document.getElementById("info" + x).innerHTML = req.responseText;

}
}




选择存储过程名称存储过程注释存储过程返回信息
';
echo '';
echo '
';
echo '';
echo '
'.$rpt.'
空信息






//[@more@]

//handle.php

<?php
$conn = oci_connect('username','pass','connect_string');
if (!$conn) {
$err = oci_error();
echo "$err";
// exit;
}
else {
if (isset($_GET['proc'])) {
$proc_name=str_replace('proc=','',$_SERVER[QUERY_STRING]);
$ret="Null value";
$do_sth="BEGIN ".$proc_name."(:o_data); END;";
$stmt=oci_parse($conn,$do_sth);
oci_bind_by_name($stmt,":o_data",$ret,32);
oci_execute($stmt);
echo $ret." - ".$proc_name;
}
else {
echo "GET URL-PROC=VALUE FAIL!";
}
}
oci_close($conn);
?>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/81211/viewspace-1000008/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/81211/viewspace-1000008/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值