从url进行Php查询
我确信这已经在stack上得到了回答,但我不知道用什么合适的术语来找到我想要的结果 我想在url中获取一个值,并将其输入到我的php脚本中。所以如果我去:从url进行Php查询,php,Php,我确信这已经在stack上得到了回答,但我不知道用什么合适的术语来找到我想要的结果 我想在url中获取一个值,并将其输入到我的php脚本中。所以如果我去: http://mydomain/search.php=“MYSEARCHQUERY” php将把MYSEARCHQUERY作为一个值 <?php $html=file_get_contents('http://anotherwebsite/MYSEARCHQUERY'); ?> URL类似于: http://mydomain
http://mydomain/search.php=“MYSEARCHQUERY”
php将把MYSEARCHQUERY
作为一个值
<?php
$html=file_get_contents('http://anotherwebsite/MYSEARCHQUERY');
?>
URL类似于:
http://mydomain/search.php?query=MYSEARCHQUERY
而PHP:
$html = file_get_contents('http://anotherwebsite/' . $_GET['query']);
URL类似于:
http://mydomain/search.php?query=MYSEARCHQUERY
而PHP:
$html = file_get_contents('http://anotherwebsite/' . $_GET['query']);
即将进行否决表决,但您的编辑很快被推到我的浏览器+1该投票的地方即将被否决,但您的编辑很快被推到我的浏览器+1在值得的地方