Javascript Iframe会话有时不工作
您好,我有一个iframe和.php页面。我试图在刷新页面时保留该页面。我使用session阻止iframe返回到它的默认src=”“页面。我在电影里看到了这个把戏。但问题是,当我尝试刷新时,有时它会阻止返回到它的默认src=“”页面,有时它会返回到它的默认src=“”页面。有什么问题Javascript Iframe会话有时不工作,javascript,php,iframe,Javascript,Php,Iframe,您好,我有一个iframe和.php页面。我试图在刷新页面时保留该页面。我使用session阻止iframe返回到它的默认src=”“页面。我在电影里看到了这个把戏。但问题是,当我尝试刷新时,有时它会阻止返回到它的默认src=“”页面,有时它会返回到它的默认src=“”页面。有什么问题 <?php session_start(); // before any output to the user-agent / browser /screen!!! print('<iframe sr
<?php
session_start(); // before any output to the user-agent / browser /screen!!!
print('<iframe src="'.$_SESSION['last_visited'].'"></iframe>')
?>
<li><a href="1.php" target="contents">1</a></li>
<li><a href="2.php" target="contents">2</a></li>
<li><a href="3.php" target="contents">3</a></li>
<li><a href="4.php" target="contents">4</a></li>
<iframe name="contents" src="index.html" id="iframe1" frameborder="0"></iframe>
你能详细说明一下吗?但问题是它有时有效有时无效。
为什么无效,控制台中有没有错误?@Ryan我更新了我的问题。对不起
<?php
session_start(); // before any output to the user-agent / browser /screen!!!
$_SESSION['last_visited'] = $_SERVER['REQUEST_URI'];
?>