首页 > php代码

php文件上传代码(带图片预览效果)(1/2)

阅读全文

ajax+php分页代码

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.phprm.com/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>php中用ajax提交查询的数据没有和数据库教程同步</title>

阅读全文

获取远程服务器网站源文件二种方法

function getsourcecode($q){
 
 return @file_get_contents($q);

}
//用curl获取网站源文件
function c_getpagecode($c_url,$p_i=0){
 $user_agent = "mozilla/4.0";
 $proxy[0] = "http://211.155.231.208:80"; //浙江省杭州市 电信idc机房
 $proxy[1] = "http://210.51.10.197:8888"; //北京市 通泰大厦网通idc机房
 $ch = curl_init();
 curl_setopt ($ch, curlopt_proxy, $proxy[$p_i]);
 curl_setopt ($ch, curlopt_url, $c_url);
 curl_setopt ($ch, curlopt_useragent, $user_agent);
 //curl_setopt ($ch, curlopt_cookiejar, "c:cookie.txt");
 curl_setopt ($ch, curlopt_header, 0);
 curl_setopt ($ch, curlopt_returntransfer, 1);
 curl_setopt ($ch, curlopt_followlocation, 1);
 curl_setopt ($ch, curlopt_timeout, 120);
 $result = curl_exec ($ch);
 curl_close($ch);
 return $result;
}

阅读全文