Submitted by 孤魂 on 2009, August 25, 9:42 AM
传说明天就是七夕了,在百度搜索了一下万年历,结果百度在搜索结果中就直接加载了一个万年历的框架,界面还比较清爽,所以就把他拔下来了!
图片附件:

附件: wnl.rar (4.83 K, 下载次数:196)
Tags: html, js
学习┊取长补短 | 评论:2
| 阅读:8183
Submitted by kalvin on 2009, August 24, 11:43 AM
PHP代码
- <?
- function uni_decode($s) {
- preg_match_all('/\&\#([0-9]{2,5})\;/', $s, $html_uni);
- preg_match_all('/[\\\%]u([0-9a-f]{4})/ie', $s, $js_uni);
- $source = array_merge($html_uni[0], $js_uni[0]);
- $js = array();
- for($i=0;$i<count($js_uni[1]);$i++) {
- $js[] = hexdec($js_uni[1][$i]);
- }
- $utf8 = array_merge($html_uni[1], $js);
- $code = $s;
- for($j=0;$j<count($utf8);$j++) {
- $code = str_replace($source[$j], unicode2utf8($utf8[$j]), $code);
- }
- return $code;
- }
-
- function unicode2utf8($c) {
- $str="";
- if ($c < 0x80) {
- $str.=chr($c);
- } else if ($c < 0x800) {
- $str.=chr(0xc0 | $c>>6);
- $str.=chr(0x80 | $c & 0x3f);
- } else if ($c < 0x10000) {
- $str.=chr(0xe0 | $c>>12);
- $str.=chr(0x80 | $c>>6 & 0x3f);
- $str.=chr(0x80 | $c & 0x3f);
- } else if ($c < 0x200000) {
- $str.=chr(0xf0 | $c>>18);
- $str.=chr(0x80 | $c>>12 & 0x3f);
- $str.=chr(0x80 | $c>>6 & 0x3f);
- $str.=chr(0x80 | $c & 0x3f);
- }
- return $str;
- }
-
- $str='%u5927%u5BB6%u597D%uFF0C我是孤魂!<br />\u8FD9\u662F\u6D4B\u8BD5\u6587\u672C\uFF01';
- echo uni_decode($str);
- ?>
Tags: php
学习┊取长补短 | 评论:1
| 阅读:3203
Submitted by 孤魂 on 2009, August 21, 5:21 PM
XML/HTML代码
- <textarea name='str' id='str' cols='80%' rows='3' onClick='select();' ondblclick='window.clipboardData.setData("text",document.getElementById("str").innerText);'>测试内容……</textarea>
效果演示:
Tags: js
学习┊取长补短 | 评论:1
| 阅读:3210
Submitted by 孤魂 on 2009, August 21, 9:11 AM
打开记事本 输入
@rasdial adsl /DISCONNECT
@rasdial adsl user password
保存为bat文件即可
说明:
adsl:宽带连接名字
user:ADSL账号
password:ADSL密码
不需要你自己手动断开网络连接,不管你有没有连接网络,只要运行这个bat即可连接,过几天写一个delphi的程序,设置间隔时间自动运行这个BAT,那就可以实现自动更换IP了,HOHO,不过目前用路由,哎!临时写了一个bat脚本,可以间隔30秒自动执行一次更换IP的命令!
adsl.bat 代码
- :letsgo
- @rasdial 宽带连接名称 /DISCONNECT
- @rasdial 宽带连接名称 用户名 密码
- @ping 0.0.0.0 -n 30 -w 1000 > nul
- goto letsgo
Tags: adsl, ip
学习┊取长补短 | 评论:2
| 阅读:4146
Submitted by 孤魂 on 2009, August 7, 10:50 AM
PHP代码
- <?php
- $cookie_file = dirname(__FILE__)."/cookie_".md5(basename(__FILE__)).".txt";
-
- function vlogin($url,$data){
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
- curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
- curl_setopt($curl, CURLOPT_POST, 1);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
- curl_setopt($curl, CURLOPT_COOKIEJAR, $GLOBALS['cookie_file']);
- curl_setopt($curl, CURLOPT_COOKIEFILE, $GLOBALS['cookie_file']);
- curl_setopt($curl, CURLOPT_TIMEOUT, 30);
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- $tmpInfo = curl_exec($curl);
- if (curl_errno($curl)) {
- echo 'Errno'.curl_error($curl);
- }
- curl_close($curl);
- return $tmpInfo;
- }
-
- function vget($url){
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
- curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
- curl_setopt($curl, CURLOPT_HTTPGET, 1);
- curl_setopt($curl, CURLOPT_COOKIEFILE, $GLOBALS['cookie_file']);
- curl_setopt($curl, CURLOPT_TIMEOUT, 30);
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- $tmpInfo = curl_exec($curl);
- if (curl_errno($curl)) {
- echo 'Errno'.curl_error($curl);
- }
- curl_close($curl);
- return $tmpInfo;
- }
-
- function vpost($url,$data){
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
- curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
- curl_setopt($curl, CURLOPT_POST, 1);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
- curl_setopt($curl, CURLOPT_COOKIEFILE, $GLOBALS['cookie_file']);
- curl_setopt($curl, CURLOPT_TIMEOUT, 30);
- curl_setopt($curl, CURLOPT_HEADER, 0);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- $tmpInfo = curl_exec($curl);
- if (curl_errno($curl)) {
- echo 'Errno'.curl_error($curl);
- }
- curl_close($curl);
- return $tmpInfo;
- }
-
- function delcookie($cookie_file){
- @unlink($cookie_file);
- }
-
-
- if(!file_exists($cookie_file)) {
- $str = vget('http://www.kalvin.cn/?action=login'); // 获取登录随机值
- preg_match("/name=\"formhash\" value=\"(.*?)\"/is",$str,$hash);
- vlogin('http://www.kalvin.cn/post.php','action=dologin&formhash='.$hash[1].'&username=aaa&password=bbb&clientcode=ccc'); // 登录获取Cookie
- }
- echo vget('http://www.kalvin.cn/');
- ?>
附件: curl_function.rar (1.14 K, 下载次数:298)
Tags: php, curl
学习┊取长补短 | 评论:4
| 阅读:6442