for ex:Google PagesPeed Insights点击
在这里
如何使用PHP中的其他页面重定向?我尝试了很多,但没有任何东西。请帮助我
首先使用此代码或类似的代码制作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);
现在您可以像这样拨打您的URL:http://yoursite/track.php?url = https://developers.google.com/speed/pagespeed/pagespeed/insights/