嗨,我想将每个 HTTP 请求的 3 个变量发送到另一个站点并希望得到响应。检查.php:
<html><body>
<form action="response.php" method="post">
<p>Variable1: <input type="text" name="var1" /></p>
<p>Vairable2: <input type="text" name="var2" /></p>
<p><input type="submit" /></p>
</form>
</body></html>
响应.php:
<?php
$url = "http://www.testpage/api.php?authcode=";
$apikey = "xxxxxxx" ;
$request = new HTTPRequest($url$apikey&$var1&$var2, HTTP_METH_POST); //req not work !
$request->send(); //nothing happens
response = $request->getResponseBody(); //only
//got
echo "$response "; //500 error
?>