June 27, 2007
推薦這個部落格: 0
August 24, 2005
<?php
// ad.php
putenv("ORACLE_SID=WWW");
putenv("NLS_LANG=american_taiwan.zht16big5");
putenv("ORACLE_HOME=/home/oracle/product/7.3.2");
putenv("LD_LIBRARY_PATH=/home/oracle/product/7.3.2/lib");
putenv("ORA_NLS=/home/oracle/product/7.3.2/ocommon/nls/admin/data");
putenv("ORA_NLS32=/home/oracle/product/7.3.2/ocommon/nls/admin/data");
$handle=ora_logon("user38@WWW","iam3849") or die;
$cursor=ora_open($handle);
ora_commitoff($handle);
$query="SELECT url, banner, alt, priority FROM ad where priority > 0";
ora_parse($cursor, $query) or die;
ora_exec($cursor);
$i=$pricount=0;
while(ora_fetch($cursor)) {
$ad[$i][0] = ora_getcolumn($cursor,0);
$ad[$i][1] = ora_getcolumn($cursor,1);
$ad[$i][2] = ora_getcolumn($cursor,2);
$ad[$i][3] = ora_getcolumn($cursor,3);
$pricount += $ad[$i][3];
$i++;
};
ora_close($cursor);
ora_logoff($handle);
srand((double)microtime()*1000000);
$pri = rand(1,$pricount);
$pricount=0;
for($i=0; $i<count($ad); $i++) {
$pricount += $ad[$i][3];
if ($pri <= $pricount) {
$ad1[]="<a href=".$ad[$i][0]." target=new><img src=/ad/".$ad[$i][1]." width=468 height=60 border=0 alt=\"".$ad[$i][2]."\"></a>";
}
}
echo $ad1[0];
?>
// ad.php
putenv("ORACLE_SID=WWW");
putenv("NLS_LANG=american_taiwan.zht16big5");
putenv("ORACLE_HOME=/home/oracle/product/7.3.2");
putenv("LD_LIBRARY_PATH=/home/oracle/product/7.3.2/lib");
putenv("ORA_NLS=/home/oracle/product/7.3.2/ocommon/nls/admin/data");
putenv("ORA_NLS32=/home/oracle/product/7.3.2/ocommon/nls/admin/data");
$handle=ora_logon("user38@WWW","iam3849") or die;
$cursor=ora_open($handle);
ora_commitoff($handle);
$query="SELECT url, banner, alt, priority FROM ad where priority > 0";
ora_parse($cursor, $query) or die;
ora_exec($cursor);
$i=$pricount=0;
while(ora_fetch($cursor)) {
$ad[$i][0] = ora_getcolumn($cursor,0);
$ad[$i][1] = ora_getcolumn($cursor,1);
$ad[$i][2] = ora_getcolumn($cursor,2);
$ad[$i][3] = ora_getcolumn($cursor,3);
$pricount += $ad[$i][3];
$i++;
};
ora_close($cursor);
ora_logoff($handle);
srand((double)microtime()*1000000);
$pri = rand(1,$pricount);
$pricount=0;
for($i=0; $i<count($ad); $i++) {
$pricount += $ad[$i][3];
if ($pri <= $pricount) {
$ad1[]="<a href=".$ad[$i][0]." target=new><img src=/ad/".$ad[$i][1]." width=468 height=60 border=0 alt=\"".$ad[$i][2]."\"></a>";
}
}
echo $ad1[0];
?>
系統公告
文章分類
最新的回應
- 目前沒有留言
tttt
好時光貼曆
人氣指數
當日人次:
累積人次:
累積人次:




