我想這個代碼刷新本身&將數據發佈到sendingms.php但不應該重定向並保留在這個page.tus每次刷新它下載新的數據併發布到sendingms.php。 PLZ建議我任何想法?刷新頁面,每次刷新時都應該發佈數據?
<?php
$page = $_SERVER['PHP_SELF'];
$sec = "15";
header("Refresh: $sec; url=$page");
$url=$_REQUEST['url'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$html= curl_exec($ch);
curl_close($ch);
//parsing begins here:
$doc = new DOMDocument();
@$doc->loadHTML($html);
$nodes = $doc->getElementsByTagName('title');
//get and display what you need:
$title = $nodes->item(0)->nodeValue;
$first = current(explode("|", $title));
$to="888888888";
header('Location: sendsms.php?to=' .$to .'&sms=' .$first);
?>
使用cURL在sendms.php上發佈數據 – Fallen