首 页   · 站长博客 · 用户注册 · 会员登陆  · 会员排行  ·最新主题  ·最近回复  精华区  版权声明  ·论坛管理
  当前登录身份:游客,请先登录。  笔名: 口令: 验证码:   
楼 主  index »  PHP+MYSQL编程 » [转帖]用PHP连接Oracle数据库·第三部分(完)  


  作者:一起php
  注册时间:2004-02-27
  主题/回复:247/1521
  积分:4649
  等级:★★★★★☆(十一级)
  称号:论坛圣人

  nqp@nqp.me
  4304410
  www.nqp.me

 

 发表:2004-04-06 00:36:13 阅读 2415 次 回复 0 次 得分0  |   字号 字色
[转帖]用PHP连接Oracle数据库·第三部分(完)
基于HTTP的Oracle登录

  将以下代码加在PHP页面代码之前以确认Oracle登录。注意你必须正确设定$ SID。

if(!isset($PHP_AUTH_USER)) 

Header("WWW-authenticate: basic realm=\"$SID\""); 
Header("HTTP/1.0 401 Unauthorized"); 
$title="Login Instructions"; 
echo " 
You are not authorized to enter the site 
\n"; 
exit; 

else 

if (!($conn=ora_logon("$PHP_AUTH_USER@$SID",$PHP_AUTH_PW))) 
{Header("WWW-authenticate: basic realm=\"$SID\""); 
Header("HTTP/1.0 401 Unauthorized"); 
$title="Login Instructions"; 
echo " 
You are not authorised to enter the site 
\n"; 
exit; 
}} 
?> 
 
  页数1/1首页 « 1 » 末页
  发表回复:您还没有登陆,无法发表回复。请先[登陆]

一起PHP技术联盟 主办:一起PHP 联系方式:站长QQ:4304410 QQ群:8423742 20159565 站长博客 E-mail: nqp@nqp.me 执行时间:0.002sec
SimsmaBBS 2008 (v6.0) Developed by 17php.com,Copyright(C)2003-2010 All rights reserved. 副本授权:一起PHP官方专用版