我有一个Android应用。我想将数据发送到我的网站按钮。 像这样: - http://mywebsite.com/gettoken=“8937623847329823904” 现在的问题是我不知道如何从网址接收数据。
这是我目前的网站文件: -
if(isset($_POST['submit']) && $_POST['post']!='')
{
$post=$_POST['post'];
$query = mysql_query("SELECT * FROM users order by id desc limit 75");
$i=1;
$token=array();
while ($row = mysql_fetch_array($query)) {
$token[$i]=$row['token'];
$url[$i] = "https://graph.facebook.com/" . $post . "/likes?method=POST&access_token=" . $token[$i];
$i++;
}
mysql_close($link);
curlMultiRequest($url, $options = array());
// print_r($results);
}
function curlMultiRequest($urls, $options = array()) {
$ch = array();
$results = array();
$mh = curl_multi_init();
foreach($urls as $key => $val) {
$ch[$key] = curl_init();
if ($options) {
curl_setopt_array($ch[$key], $options);
}
curl_setopt($ch[$key], CURLOPT_URL, $val);
curl_setopt($ch[$key], CURLOPT_HEADER, 0);
curl_setopt($ch[$key], CURLOPT_RETURNTRANSFER, TRUE);
curl_multi_add_handle($mh, $ch[$key]);
}
$running = null;
do {
usleep(100000);
curl_multi_exec($mh, $running);
}while ($running > 0);
// Get content and remove handles.
foreach ($ch as $key => $val) {
// $results[$key] = curl_multi_getcontent($val);
curl_multi_remove_handle($mh, $val);
}
curl_multi_close($mh);
// return $results;
}
?>
<form method="post" action="" onsubmit="javascript: document.getElementById('show').style.display='block';">
<input type="text" name="post"><br/><br/>
<input type="submit" value="submit" name="submit">
</form>