gpt4 book ai didi

php - 重定向到同一页面以锚定

转载 作者:IT王子 更新时间:2023-10-29 00:05:50 24 4
gpt4 key购买 nike

<分区>

需要从 http://sitename.com/cat/index.php 进行重定向至 http://sitename.com/cat/index.php#anchor

我尝试了两种方式:php 重定向和元刷新

PHP 重定向

<?php
$URL = "http://sitename.com/cat/index.php#anchor";
header("Location: $URL");
?>
<html>
....

元刷新

<html>
<head>
...
<meta http-equiv="refresh" content="0;url=http://sitename.ru/cat/index.php#anchor">
...
</head>
...
</html>

这两种方式的结果都是我循环刷新页面。

如何正确解决这个问题?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com