Today I learned the function of Curl extension. wrote a httppost function, which I think can be used to do online updates. Or download remote resources online.
[PHP]
Echo HttpPost ("Http://bbs.125.la/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes &lssubmit=yes&inajax=1 ",
Array (
"Handlekey" = "ls",
"Password" = "123456",
"Quickforward" = "yes",
"Username" = "admin"
));
function HttpPost ($url, $sendData)
{
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_returntransfer, 1);
We're in post data Oh!
curl_setopt ($ch, Curlopt_post, 1);
Add the post variable to the
curl_setopt ($ch, Curlopt_postfields, $sendData);
$output = curl_exec ($ch);
Curl_close ($ch);
return $output;
}
Echo HttpPost ("Http://bbs.125.la/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes &lssubmit=yes&inajax=1 ",
Array (
"Handlekey" = "ls",
"Password" = "123456",
"Quickforward" = "yes",
"Username" = "admin"
));
function HttpPost ($url, $sendData)
{
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_returntransfer, 1);
We're in post data Oh!
curl_setopt ($ch, Curlopt_post, 1);
Add the post variable to the
curl_setopt ($ch, Curlopt_postfields, $sendData);
$output = curl_exec ($ch);
Curl_close ($ch);
return $output;
}
The following is the standard MySQL query data and combines the code of the array
[PHP]
$conn =mysql_connect (' localhost ', ' root ', ' 1234 ');
mysql_select_db (' Kefei ');
mysql_query ("Set names UTF8");
$result =mysql_query ("SELECT * from Liuyan");
$arr =array ();
while ($row =mysql_fetch_assoc ($result)) {
$arr []= $row
}
Var_dump ($arr);
http://www.bkjia.com/PHPjc/477369.html www.bkjia.com true http://www.bkjia.com/PHPjc/477369.html techarticle today I learned the function of Curl extension. wrote a httppost function, which I think can be used to do online updates. Or download remote resources online. [PHP] Echo httppost ( ...