Home > Backend Development > PHP Tutorial > 请php高手帮个忙,如何远程调用参数

请php高手帮个忙,如何远程调用参数

WBOY
Release: 2016-06-13 11:49:42
Original
982 people have browsed it

请php高手帮个忙,怎么远程调用参数?

本帖最后由 kwdpx 于 2014-02-22 11:52:42 编辑 这是另一个网站上的网页:
<br /><?php<br />require_once("header.php");<br /><br /><br />$qgs="select * from members where username='$user'";<br />$rgs=$obj_db->simplequery($qgs);<br />$ngs=mysql_num_rows($rgs);<br />if ($ngs=="1"){<br />$jd_bbs="1";<br /><br />}else{<br />$jd_bbs="0";<br />}<br />?>
Copy after login



我想在这个网站上调用那个网站网页运行得到的参数$jd_bbs
<br /><?php<br />file_get_contents("http://www.xxx.com/b/index.php?user=$user");<br /><br />if($jd_bbs!="1"){<br /> echo "$jd_bbs";//如何得到?<br />exit();<br />}<br />?><br />
Copy after login

------解决方案--------------------
require_once("header.php");
 
 
$qgs="select * from members where username='$user'";
$rgs=$obj_db->simplequery($qgs);
$ngs=mysql_num_rows($rgs);
$jd_bbs = 0;
if ($ngs=="1"){
$jd_bbs="1";
 
}else{
$jd_bbs="0";
}

echo $jd_bbs;
?>

上面是修改你的
下面是另一个网站获取

$ch = curl_init("上面网站网址");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);

$rRes = curl_exec($ch);//得到结果
curl_close($ch);
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template