Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用将人们重定向到用户特定页面的 php 登录页面。当用户访问这些页面时,它仍然在 url 中显示 php 登录页面。
您能帮我找到一种方法,让新页面上的 html(或 php)代码一次重新加载页面,以便在重定向后成为该页面。(由于这个问题,我在这些页面上遇到了功能问题)?
您不能使用 PHP 来刷新页面。一旦页面加载到浏览器中,PHP 就会失去控制,无法修改页面内容。
要重新加载/刷新文档,您可以使用 HTML 或 JavaScript。
使用 HTML 每 30 秒刷新一次文档:
<meta http-equiv="refresh" content="30">
使用 JavaScript:
<input type="button" value="Reload Page" onClick="window.location.reload()">
希望这可以帮助!