摘要:<?php function cacheArr(&$data){ if(!$data)throw new Exception('数组不能为空'); foreach($GLOBALS as $key=>$value){ $str=$GLOBALS[$key]; $GLOBALS[$key]='changed'; if(&$data=='changed'){ $strName=$key; break; } $GLOBALS[$key]=$str; } ob_clean(); ob_start(); echo "&
阅读全文
摘要:PHP文件读取函式//文件读取函式function PHP_Read($file_name) {$fd=fopen($file_name,r);while($bufline=fgets($fd, 4096)){$buf.=$bufline;}fclose($fd);return $buf;}?>文件写入函式//文件写入函式function PHP_Write($file_name,$data,$method=”w”) {$filenum=@fopen($file_name,$method);flock($filenum,LOCK_EX);$file_data=fwrite($filenu
阅读全文
摘要:CURL确实很强悍,可以伪造IP和来源。1.php 请求 2.php 。1.php代码:$ch = curl_init();curl_setopt($ch, CURLOPT_URL, "http://localhost/2.php");curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:8.8.8.8', 'CLIENT-IP:8.8.8.8')); //构造IPcurl_setopt($ch, CURLOPT_REFERER, "http://www.gosoa.
阅读全文
摘要:PHP支持的由Daniel Stenberg创建的libcurl库允许你与各种的服务器使用各种类型的协议进行连接和通讯。libcurl目前支持http、https、ftp、 gopher、telnet、dict、file和ldap协议。libcurl同时也支持HTTPS认证、HTTP POST、HTTP PUT、 FTP 上传(这个也能通过PHP的FTP扩展完成)、HTTP 基于表单的上传、代理、cookies和用户名+密码的认证。php的curl真的是相当好用,网上一搜索相关文章都是关于curl模拟登陆的,很少人提供模拟discuz发贴的源码。<?php$discuz_url =
阅读全文