利用oci向数据表 'email_info' 输入数据
同上,只不过用oci来写
相关php代码:
if ($submit == "click"){
// the submit button was clicked!
// get the input for fullname and email then store it in the database.
putenv("oracle_sid=orasid");
$connection = ocilogon ("username","password");
if ($connection == false){
echo ocierror($connection)."
";
exit;
}
$query = "insert into email_info values ('$fullname', '$email')";
$cursor = ociparse ($connection, $query);
if ($cursor == false){
echo ocierror($cursor)."
";
exit;
}
$result = ociexecute ($cursor);
if ($result == false){
echo ocierror($cursor)."
";
exit;
}
ocicommit ($connection);
ocilogoff ($connection);
}
else{
echo '
<form action=insert.php method=post>
请输入姓名
<input name=fullname></input>
请输入 email 地址
<input name=email></input>
<input name=submit type=submit value=click></input>
</form>
';
}
?>
对了,这段脚本必须存为insert.php,因为在调用的页面中指定insert.php为表单处理程序
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器