我想要这样的东西:
<?php
if($something)
header('Location:javascript:history.go(-2)');
?>
但是 header('Location:javascript:history.go(-2)');
不起作用。还有其他选择吗?
我不知道用户刚刚访问的页面,所以我无法对 url 进行硬编码。
最佳答案
从您的 Angular 来看,我认为您可能正在寻找这样的东西:
<html><head></head><body>
<?php
if($something){
?>
<script type="text/javascript">
window.history.go(-2);
</script>
<?php
}
?>
</body></html>
关于PHP:浏览器返回一个页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7466286/