答案 0 :(得分:0)
首先使用此代码或类似代码制作track.php:
if(isset($_REQUEST["url"])) {
$url = $_REQUEST["url"];
} else {
// Error url is not set
exit();
}
// Your count code here to store in database
$mysqli = new mysqli("server", "user", "password", "database");
$url = $mysqli->real_escape_string($url); // For security
$mysqli->query(sprintf("INSERT INTO tracks ('%s');", $url));
// Redirect
header("Location: " . $url);
现在您可以这样调用您的网址:http://yoursite/track.php?url=https://developers.google.com/speed/pagespeed/insights/