$value) { $content[$key] = addslashes($value); } } else { addslashes($content); } } return $content; } function chk_parm($parm){ if($parm=='' or strpos($parm,' ') >0 ) return 0; return 1; } function chk_email($str){ if (ereg('^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)*(.com|.net|.gov|.cn)$',$str)) return 1; return 0; } function chk_digtal($parm) { return (strval(intval($parm))==$parm) ? 1 : 0; } function is_digtal($parm) { return (strval(intval($parm))==$parm) ? 1 : 0; } function unset_all_vars($a) { foreach($a as $key => $val) { unset($GLOBALS[$key]); } unset($a, $key, $val); // return serialize($a); } function send_back($err_str,$back_url='back'){ echo "'; exit; } function mbb_substr($str, $len = 80) { if(strlen($str) > $len) { $temp = 0; for($i=0; $i<$len; $i++) { if(ord($str[$i]) > 0xa0) $temp++; } if($temp%2 == 0) { $str = substr($str, 0, $len); } else { $str = substr($str, 0, $len+1); } } return $str; } function mbb_str_to($str, $mode ="tolower") { $len =strlen($str); if($mode == "tolower") { for($i=0; $i<$len; $i++) if(ord($str[$i]) >= 65 && ord($str[$i]) <= 90) $str[$i] = strtolower($str[$i]); } else { for($i=0; $i<$len; $i++) if(ord($str[$i]) >= 97 && ord($str[$i]) <= 122) $str[$i] = strtoupper($str[$i]); } return $str; } function remove_last($str, $needle) { if(strrchr($str, $needle)==$needle) return substr($str,0,strlen($str)-1); } function format_text($str) { return str_replace("\n","
",str_replace(" "," ",$str)); } function deal_post($parm) { if($parm<>'') return htmlspecialchars($parm); } function deal_badword($str,$target='login'){ $str = addslashes($str); $str = str_replace(';','',$str); if($target=='login') $str = str_replace(' ','',$str); return $str; } class Pager{ var $url; var $countall; var $page; var $thestr; var $backstr; var $nextstr; var $pg; function Pager($countall,$countlist){ @$this->pg=sprintf("%d",$_GET["pg"]); if ($this->pg==0){ $this->pg=1; } if (!isset($this->pg)){ $this->pg=1; } $this->countall = $countall; if ($this->countall%$countlist!=0){ $this->page=sprintf("%d",$this->countall/$countlist)+1; } else{ $this->page=$this->countall/$countlist; } $this->url = Pager::getUrl(); if ($this->page<=10){ for ($i=1;$i<$this->page+1;$i++){ $this->thestr=$this->thestr.Pager::makepg($i,$this->pg); } } else{ if ($this->pg<=5){ for ($i=1;$i<10;$i++){ $this->thestr=$this->thestr.Pager::makepg($i,$this->pg); } } else{ if (6+$this->pg<=$this->page){ for ($i=$this->pg-4;$i<$this->pg+6;$i++){ $this->thestr=$this->thestr.Pager::makepg($i,$this->pg); } } else{ for ($i=$this->pg-4;$i<$this->page+1;$i++){ $this->thestr=$this->thestr.Pager::makepg($i,$this->pg); } } } } $this->backstr = Pager::gotoback($this->pg); $this->nextstr = Pager::gotonext($this->pg,$this->page); echo ($this->backstr.$this->thestr.$this->nextstr." 共".$this->countall." 条记录,每页".$countlist."条,共".$this->page."页"); } function makepg($i,$pg){ if ($i==$pg){ return " ".$i.""; } else{ return " ".$i.""; } } function gotoback($pg){ if ($pg-1>0){ return $this->gotoback=" 首页 上一页"; } else{ return $this->gotoback=""; } } function gotonext($pg,$page){ if ($pg < $page){ return " 下一页 尾页"; } else{ return ""; } } function replacepg($url,$flag,$i){ if ($flag == 1){ $temp_pg = $this->pg; return str_replace("pg=".$temp_pg,"pg=".($this->pg+1),$url); } else if($flag == 2) { $temp_pg = $this->pg; return str_replace("pg=".$temp_pg,"pg=".($this->pg-1),$url); } else if($flag == 3) { $temp_pg = $this->pg; return str_replace("pg=".$temp_pg,"pg=1",$url); } else if($flag == 4){ $temp_pg = $this->pg; return str_replace("pg=".$temp_pg,"pg=".$this->page,$url); } else if($flag == 5){ $temp_pg = $this->pg; return str_replace("pg=".$temp_pg,"pg=".$i,$url); } else{ return $url; } } function getUrl(){ $url="http://".$_SERVER["HTTP_HOST"]; if(isset($_SERVER["REQUEST_URI"])){ $url.=$_SERVER["REQUEST_URI"]; } else{ $url.=$_SERVER["PHP_SELF"]; if(!empty($_SERVER["QUERY_STRING"])){ $url.="?".$_SERVER["QUERY_STRING"]; } } if (!ereg("(pg=|PG=|pG=|Pg=)", $url)){ if (!strpos($url,"?")){ $url = $url."?pg=1"; } else{ $url = $url."&pg=1"; } } return $url; } } function check_date($date) { //检查日期是否合法日期 $dateArr = explode("-", $date); if (is_numeric($dateArr[0]) && is_numeric($dateArr[1]) && is_numeric($dateArr[2])) { return checkdate($dateArr[1],$dateArr[2],$dateArr[0]); } return false; } ?>
( ! ) Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in D:\wamp64\www\autosino\supplierPriceAdd.php on line 13
Call Stack
#TimeMemoryFunctionLocation
10.0004260256{main}( )...\supplierPriceAdd.php:0
20.0197354688mysql_query ( )...\supplierPriceAdd.php:13

( ! ) Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in D:\wamp64\www\autosino\supplierPriceAdd.php on line 13
Call Stack
#TimeMemoryFunctionLocation
10.0004260256{main}( )...\supplierPriceAdd.php:0
20.0197354688mysql_query ( )...\supplierPriceAdd.php:13

( ! ) Warning: mysql_query(): A link to the server could not be established in D:\wamp64\www\autosino\supplierPriceAdd.php on line 13
Call Stack
#TimeMemoryFunctionLocation
10.0004260256{main}( )...\supplierPriceAdd.php:0
20.0197354688mysql_query ( )...\supplierPriceAdd.php:13

( ! ) Fatal error: Call to undefined function deal_post() in D:\wamp64\www\autosino\supplierPriceAdd.php on line 15
Call Stack
#TimeMemoryFunctionLocation
10.0004260256{main}( )...\supplierPriceAdd.php:0