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

php ͨ¹ýfsockopen Ä£ÄâPOSTÌá½»


$URL
=‘
http
:
//xxx.xxx.xxx.xx/xx/xxx/top.php';
$post_data
[
'
clientname
'
]
=
"
test08
"
;
$post_data
[
'
clientpasswd
'
]
=
"
test08
"
;
$post_data
[
'
submit
'
]
=
"
¥í¥°¥¤¥ó
"
;
$referrer
=
""
;
// parsing the given URL
$URL_Info
=
parse_url
(
$URL
)
;
// Building referrer
if
(
$referrer
==
""
)

// if not given use this script as referrer
$referrer
=
$_SERVER
[
"
SCRIPT_URI
"
]
;
 
// making string from $data
foreach
(
$post_data

as

$key
=>
$value
)
$values
[]
=
"
$key
=
"
.
urlencode
(
$value
)
;
 
$data_string
=
implode
(
"
&
"
,
$values
)
;
// Find out which port is needed - if not given use standard (=80)
if
(
!
isset
(
$URL_Info
[
"
port
"
]))
$URL_Info
[
"
port
"
]
=
80
;
// building POST-request:
$request
.=
"
POST
"
.
$URL_Info
[
"
path
"
]
.
"
HTTP/1.1
\n
"
;
$request
.=
"
Host:
"
.
$URL_Info
[
"
host
"
]
.
"
\n
"
;
$request
.=
"
Referer:
$referrer
\n
"
;
$request
.=
"
Content-type: application/x-www-form-urlencoded
\n
"
;
$request
.=
"
Content-length:
"
.
strlen
(
$data_string
)
.
"
\n
"
;
$request
.=
"
Connection: close
\n
"
;
$request
.=
"
\n
"
;
$request
.=
$data_string
.
"
\n
"
;
$fp
=
fsockopen
(
$URL_Info
[
"
host
"
]
,
$URL_Info
[
"
port
"
])
;
fputs
(
$fp
,
$request
)
;
while
(
!
feof
(
$fp
))

{
    
$result
.=
fgets
(
$fp
,
128
)
;
}
fclose
(
$fp
)
;


Ïà¹ØÎĵµ£º

php²âÊÔÓû§ÍøËÙ

Ê×ÏÈ´´½¨½«´«Ê䏸Óû§µÄÊý¾ÝÎļþ¡£Õâ¸öÎļþ¿ÉÒÔÓÐÈκÎÄÚÈÝ£¬²»Óõ£ÐÄ£¬ÒòΪÓû§ÓÀÔ¶¶¼¿´²»µ½Õâ¸öÎļþ¡£ÎÒÃÇ¿¼ÂÇÉú³É´óÁ¿Îı¾²¢Ð´Èëµ½ÎļþÀ´´´½¨´ËÎļþ¡£ÀýÈçϱߵĽű¾½«Éú³ÉÒ»¸ö´óÔ¼1500KBµÄÎı¾Îļþ¡££¨ÔÝÖ»ÌṩÕâ¸ö˼·£¬¾ßÌåÂÔ..£©
<?php
/*=====http://hi.csdn.net/yinyiniao=====*/
$fp=fopen("cs.txt","w");
......

PHP ×Ö·û´®½ØÈ¡

<?php
//$str = "abcdef¡ôÖлªÈËÃñ¹²ºÍ¹ú";
//$str = "1234567890";
$str = "ÖлªÈËÃñ¹²ºÍ¹úabcÖлªÈËÃñ¹²ºÍ¹úÖлªÈËÃñ¹²ºÍ¹ú";
$str = cut_str($str, 18);
echo $str;
function cut_str($str, $len){
 if(strlen($str) <= $len) return $str;
 $n = 0;
 $tempstr = '';
 for($i = 0; ......

php dateʱ¼ä±¾µØ»¯ÎÊÌ⣨ת£©


½ñÌìÔÚдһ¸ö¶«Î÷ʱ£¬·¢ÏÖʱ¼äÒ»Ö±¶Ô²»ÉÏ£¬date("Y-m-d h:i:s") ×ÜÊÇÓë·þÎñÆ÷ʱ¼ä²î¼¸¸öСʱ£®
Ô­À´´Óphp5.1.0¿ªÊ¼£¬php.iniÀï¼ÓÈëÁËdate.timezoneÕâ¸öÑ¡ÏĬÈÏÇé¿öÏÂÊǹرյÄ
Ò²¾ÍÊÇÏÔʾµÄʱ¼ä£¨ÎÞÂÛÓÃʲôphpÃüÁ¶¼ÊǸñÁÖÍþÖαê׼ʱ¼ä
ºÍÎÒÃǵÄʱ¼ä£¨±±¾©Ê±¼ä£©²îÁËÕýºÃ8¸öСʱ

½â¾ö·½Ê½:

Ò»¡ ......

ÐÂÀËPHP¹¤³Ìʦ±ÊÊÔÌâ

1. дһ¸öº¯Êý£¬¾¡¿ÉÄܸßЧµÄ£¬´ÓÒ»¸ö±ê×¼ url
ÀïÈ¡³öÎļþµÄÀ©Õ¹Ãû
   ÀýÈç: http://www.sina.com.cn/abc/de/fg.php
?id=1
ÐèҪȡ³ö php »ò .php
2. ÔÚ HTML ÓïÑÔÖУ¬Ò³ÃæÍ·²¿µÄ meta ±ê¼Ç¿ÉÒÔÓÃÀ´Êä³öÎļþµÄ±àÂë
¸ñʽ£¬ÒÔÏÂÊÇÒ»¸ö±ê×¼µÄ meta Óï¾ä
   <META http-equiv='Content-Type
' ......

phpÃæÊÔÌâÄ¿(ÒÑ×¢´ð°¸)


¼òÊöÌâ(50·Ö)()
1¡¢ÓÃPHP´òÓ¡³öǰһÌìµÄʱ¼ä¸ñʽÊÇ2006-5-10 22:21:21(2·Ö)
echo date('Y-m-d H:i:s', strtotime('-1 day'));
»òÕß
$yesterday = time() - (24 * 60 * 60);
echo 'today:'.date('Y-m-d H:i:s')."\n";
echo 'yesterday:'. date('Y-m-d H:i:s', $yesterday)."\n";
2¡¢echo(),pr ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ