$myfile?=?fopen("D:/WWW/hmd/heimingdan.txt",?"a");//打開(kāi)txt?將文件指針指向文件末尾??自己定義路徑

成都創(chuàng)新互聯(lián)公司自2013年起,是專(zhuān)業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目網(wǎng)站設(shè)計(jì)、成都網(wǎng)站設(shè)計(jì)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元洞頭做網(wǎng)站,已為上家服務(wù),為洞頭各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:18980820575
$SaveTxt?=?$_GET["url"];??????????????????????????//獲得要保存的數(shù)據(jù)
fwrite($myfile,?$SaveTxt?.?"\r\n");???????????????//保存到txt并換行
fclose($myfile);??????????????????????????????????//關(guān)閉txt
用PHP向服務(wù)器發(fā)送HTTP的POST請(qǐng)求,代碼如下:
?php
/**????
*?發(fā)送post請(qǐng)求????
*?@param?string?$url?請(qǐng)求地址????
*?@param?array?$post_data?post鍵值對(duì)數(shù)據(jù)????
*?@return?string????
*/????
function?send_post($url,?$post_data)?{????
$postdata?=?http_build_query($post_data);????
$options?=?array(????
'http'?=?array(????
'method'?=?'POST',????
'header'?=?'Content-type:application/x-www-form-urlencoded',????
'content'?=?$postdata,????
'timeout'?=?15?*?60?//?超時(shí)時(shí)間(單位:s)????
)????
);????
$context?=?stream_context_create($options);????
$result?=?file_get_contents($url,?false,?$context);?????????????
return?$result;????
}
使用的時(shí)候直接調(diào)用上面定義的send_post方法:
$post_data?=?array(
'username'?=?'username',
'password'?=?'password'
);
send_post('網(wǎng)址',?$post_data);
在php表單中
單選按鈕
如果選中了提交后,就是這個(gè)單選按鈕的值,如果沒(méi)有選中,提交是空值。
比如
在提交后
如果是選中打鉤的,在php
獲取到的值就是
echo
$_post['a']
//輸出
1
如果沒(méi)有選中,在php
獲取到的值就是
echo
$_post['a']
//輸出
if
(empty($_post['a']))
{
$a=0;
}else{
$a=$_post['a'];
}
新聞標(biāo)題:php提交提現(xiàn)數(shù)據(jù) phpget提交
網(wǎng)站路徑:http://www.chinadenli.net/article28/dddgpjp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)、Google、網(wǎng)站建設(shè)、云服務(wù)器、網(wǎng)站收錄、微信小程序
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)