Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHPÄ£ÄâµÇ½µÄʵÏÖ

֮ǰ²Î¼ÓѧУµÄÌôÕ½±­£¬×öÁËÒ»¸öСµÄÊÖ»úÍøÕ¾ÏîÄ¿£¬ÆäÖÐҪʵÏֵǽѧУУÄÚÓÊÏ䣬¿¼Âǵ½ÊÖ»úÓû§¶ËûÓа취ֱ½Ó·ÃÎÊѧУÍøÒ³¡£ÓÚÊÇÏëµ½ÁËʹÓÃphpʵÏÖÄ£ÄâµÇ½£¬ÓÐЩÐíµÄÐĵá£Ë³±ã¼Ç¼һÏ¡£
ÔÚÎÒÃÇѧУµÄÓÊÏäµÇ½ҳÃæµÄµÇ½±íµ¥µÄÄÚÈÝÓÐÓû§ÃûºÍÃÜÂ룬ûÓÐÑéÖ¤Âë»úÖÆ£¬ÕâÑù±È½ÏºÃ°ì¡£´ÓÔ´ÎļþÀï¼ÇÏÂ±íµ¥ÀïÓÐusernameºÍpasswordÏî¡£ÄÇôÎÒÃÇ¿ÉÒÔÏò´¦ÀíµÄÒ³ÃæÌá½»ÕâЩÊý¾Ý£¬½ÓÏÂÀ´Òª¹¹ÔìhttpÍ·£¬²ÅÄÜÄ£Äâä¯ÀÀÆ÷·¢³öµÄhttpÇëÇó¡£ÎÒÓÃhttpWatchProÀ´×¥°ü£¬ÖªµÀÁËѧУÓʼþ·þÎñÆ÷·µ»ØµÄcookie¸ñʽ¡£½ÓÏÂÀ´¹Ø¼üµÄÒ»²½¾ÍÊÇÒª¼Ç¼Ï·µ»ØµÄcookieÖµ£¬ÕâÑù²ÅÄܱ£³ÖµÇ¼״̬¡£ÏÂÃæÊǹ¹ÔìhttpÍ·µÄ·½·¨ºÍ¸ñʽ¡£
$flag = 0;
$argv = arra('username'=>$UseID, 'password'=>$Password);
//$UseIDºÍ$Password·Ö±ð±£´æÁËÓû§µÄÕ˺ÅÃûºÍÃÜÂë
foreach ($argv as $key=>$value)
{
if ($flag!=0)
{
$params .= "&";
$flag = 1;
}
$params.= $key."=";
$params.= urlencode($value);
$flag = 1;
}
$length = strlen($params);//»ñÈ¡¸ñʽºÃºóµÇ½ÐÅÏ¢³¤¶È
$header .= "POST /xxx.jsp HTTP/1.1\r\n";//xxx.jspλ´¦ÀíÒ³Ãæ
$header .= "Accept: */*\r\n";
$header .= "Host: www.XXXX.edu.cn\r\n";
$header .= "Referer: http://www.XXXX.edu.cn/index.jsp\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: ".$length."\r\n";
$header .= "Connection: Keep-Alive\r\n\r\n";
//��ï¿絧ost���ַ�
$header .= $params."\r\n";
ÔÚ¹¹ÔìºÃhttpÍ·ºó¾Í¿ÉÒÔʹÓÃsocket·½Ê½½øÐÐÁ¬½Ó¡£
//´ò¿ªsocket½øÐÐÁ¬½Ó£¬www.XXXX.edu.cnΪÐèÒªµÇ½µÄÖ÷»úµØÖ·
$fp = fsockopen("www.XXXX.edu.cn",80,$errno,$errstr,10) or exit($errstr."--->".$errno);
fputs($fp,$header);

for($i=0;$i<=22;$i++){
$line .= fgets($fp,1024);
}
fclose($fp);
//·µ»ØµÄÊý¾Ý±£´æÔÚ$line±äÁ¿µ±ÖÐ
ͨ¹ý·ÖÎö·µ»ØµÄÊý¾Ý£¬ÎÒÃǾͿÉÒÔ»ñµÃcookieµÄÖµ¡£ÔÚÖ®ºóµÄÇëÇóÖÐÖ»ÒªÔÚhttpÇëÇóµ±ÖмÓÈëcookieµÄÖµ£¬¾ÍÄܹ»ÊµÏÖÄ£ÄâµÇ½µÄ¹¦ÄÜ£¬Ê£ÏÂÀ´¾ÍÊÇ·ÖÎö¹ýÂË·µ»ØµÄÒ³Ã湤×÷£¬¿ÉÒÔʹÓÃÕýÔò±í´ïʽ¡£ÎªÁ˼ò»¯²Ù×÷£¬ÎÒÔÚºóÃæµÄ²Ù×÷ÖÐʹÓÃÁËÒ»¸ö½ÐSnoopyµÄÀàÎļþ£¬Õâ¸öÀÏÍâдµÄÀàÀïÃæ·â×°Á˺öàÏà¹ØµÄ¹¦ÄÜ¡£ºóÀ´Ô


Ïà¹ØÎĵµ£º

ÓÃphpµ÷ÕûͼƬ¿í¸ß

<?php
/**
* ¸Ä±äͼƬµÄ¿í¸ß
*
* @author flynetcn (2009-12-16)
*
* @param string $img_src ԭͼƬµÄ´æ·ÅµØÖ·»òurl
* @param string $new_img_path ÐÂͼƬµÄ´æ·ÅµØÖ·
* @param int $new_width ÐÂͼƬµÄ¿í¶È
* @param int $new_height ÐÂͼƬµÄ¸ß¶È
* @return bool ³É¹¦true, ʧ°Üfalse
* ......

jquery php ajax

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> TEST </title>
<meta name="generator" content="editplus" /> ......

³£ÓÃPHPº¯Êý

ÕâÊÇһЩʹÓÃƵÂʱȽϸߵĺ¯Êý£¬ÓеÄÀ´×Ô±ðÈ˵ijÌÐò......
1.²úÉúËæ»ú×Ö·û´®º¯Êý
function random($length) {
 $hash = '';
 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
 $max = strlen($chars) - 1;
 mt_srand((double)microtime() * 1000000);
 for($ ......

php ÖÐ$_SESSIONµÄÀí½â

       PHPÓкܶàÖµµÃѧϰµÄµØ·½£¬ÕâÀïÎÒÃÇÖ÷Òª½éÉÜPHP SessionʹÓá£ÔÚPHP¿ª·¢ÖжԱÈÆðCookie£¬session ÊÇ´æ´¢ÔÚ·þÎñÆ÷¶ËµÄ»á»°£¬Ïà¶Ô°²È«£¬²¢ÇÒ²»Ïñ Cookie ÄÇÑùÓд洢³¤¶ÈÏÞÖÆ£¬ÏÂÃæÎÒÃǾͼòµ¥½éÉÜ PHP SessionʹÓá£
 
¡¡¡¡ÓÉÓÚ Session ÊÇÒÔÎı¾ÎļþÐÎʽ´æ´¢ÔÚ·þÎñÆ÷¶ËµÄ£¬ËùÒÔ² ......

php date()º¯Êý˵Ã÷

string date ( string format [, int timestamp] )     //ÆäÖÐtimestampΪ¿ÉÑ¡£¬Ä¬ÈÏֵΪtime();
date("1");    //Monday
date("m.d.y");   //12.21.09
date("m.d.Y");//12.21.2009
$tomorrow  = mktime(0, 0, 0, date("m")  , date("d")+1, date("Y"));
$las ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ