查看文件: BE2.php
大小: 4.19 KB
类型: application/octet-stream
<?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_BE2 = "localhost"; $database_BE2 = "newskybni"; $username_BE2 = "root"; $password_BE2 = "loskyoc"; $BE2 = mysql_pconnect($hostname_BE2, $username_BE2, $password_BE2) or trigger_error(mysql_error(),E_USER_ERROR); if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } if (!function_exists("ilogo_img")) { function ilogo_img(){ $hostname_BE2 = "localhost"; $database_BE2 = "newskybni"; $username_BE2 = "root"; $password_BE2 = "loskyoc"; $BE2 = mysql_pconnect($hostname_BE2, $username_BE2, $password_BE2) or trigger_error(mysql_error(),E_USER_ERROR); // logo data $menu1=isset($_GET['menu'])?$_GET['menu']:'index'; // $dirname = dirname(__FILE__); $REQUEST_URI=$_SERVER['REQUEST_URI']; $pos = strpos($REQUEST_URI, '/',1); $MEMBER_URI=''; if($pos>0){ $MEMBER_URI=substr($REQUEST_URI,$pos+1); $REQUEST_URI=substr($REQUEST_URI,0,$pos+1); }else{ $REQUEST_URI='/' ;} //SELECT a.lcode as acode,a.doc1 as adoc1,a.doc2 as adoc2,a.doc3 as adoc3,b.* FROM logo_img as a left join logo_img as b on a.lurlbase=b.lurlbase and b.lurl='su99291' WHERE a.lurlbase='/ecard/' AND a.lurl='index' mysql_select_db($database_BE2, $BE2); $req=$REQUEST_URI; $menu1 = trim($menu1); if($req=='/shop/'){ $menu1 .='.html' ;} $url_logoarr=array('/ecard/','/vipecard/'); if (in_array($REQUEST_URI,$url_logoarr)){ $menu1 ='index' ;} // ecard use index $query_Lo1 = sprintf("SELECT * FROM logo_img WHERE lurl ='%s' and lurlbase ='%s' ",$menu1,$REQUEST_URI); $Lo1 = mysql_query($query_Lo1, $BE2) or die(mysql_error()); $row_Lo1 = mysql_fetch_assoc($Lo1); $totalRows_Lo1 = mysql_num_rows($Lo1); // if ( $_SERVER['REMOTE_ADDR']=='220.130.43.118'){ echo $query_Lo1 ; } $logo_image=array( array('logo20231127200457_1.png','logo20231127200457_2.png','logo20231127200457_3.png'), array('天空商城','天空商城','skybni') ); // global $MYDEBUG; /* if ( $_SERVER['REMOTE_ADDR']=='220.130.43.118'){ echo $query_Lo1." ; >> <br>"; echo $_SERVER['REQUEST_URI']."<br>=" ; echo $MEMBER_URI.">> <br>"; } */ // lo1 if($totalRows_Lo1>0){ $imgpath= '/www2/skybni/logo_img/'.$row_Lo1['lcode']; if( file_exists($imgpath.'_1.png')){$logo_image[0][0]= $row_Lo1['lcode'].'_1.png';} if( file_exists($imgpath.'_2.png')){ $logo_image[0][1]= $row_Lo1['lcode'].'_2.png'; if($REQUEST_URI=='/vipecard/'){ if($MEMBER_URI<>''){ if( file_exists('/www2/skybni/logo_img/Vip_'.$MEMBER_URI.'.png')){ $logo_image[0][1]='Vip_'.$MEMBER_URI.'.png'; }else{$logo_image[0][1]='b1.png'; } }else{$logo_image[0][1]='b1.png'; } } } if( file_exists($imgpath.'_3.png')){$logo_image[0][2]= $row_Lo1['lcode'].'_3.png';} $logo_image[1][0]=$row_Lo1['doc1']; $logo_image[1][1]=$row_Lo1['doc2']; $logo_image[1][2]=$row_Lo1['doc3']; } mysql_free_result($Lo1); return $logo_image; } } //if ( $_SERVER['REMOTE_ADDR']=='220.130.43.118'){ // echo $query_Lo1; //for($c=0;$c<2;$c++){ // echo $rlogo[$c][0].','.$rlogo[$c][1].','.$rlogo[$c][2]."<br>"; // } // echo $_SERVER['REQUEST_URI'].",". $query_Lo1.','.$REQUEST_URI; // } mysql_query("SET NAMES UTF8"); ?>
保存
取消
返回文件列表