我正在使用000webhosting.com。我上传了一个文件check.php
<?php
$url = 'http://www.otherdomain.com/login/?';
$data = array('user' => 'admin',
'pass' => 'password');
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }
var_dump($result);
?>
当我致电www.000webhosting.com/check.php时,它会返回string(0) ""
然而,当我在allcodez.com上传check.php并致电www.allcodez.com/check.php时,它会返回{"status":"true", "login":"true"}
。
000webhosting.com设置有问题吗?还是其他什么?