我要注册或者登陆后,跳转到当前浏览的页面,怎么实现?

解决方案 »

  1.   

    1楼告诉你了

    header//注册验证通过
    if($isReg){
    header('Location: http://www.example.com/index.php');
    }函数用法
    http://www.w3school.com.cn/php/func_http_header.asp
      

  2.   

    你需要记录之前的页面,方法就很多了。在url 或者session/cookie 都可。
      

  3.   

    header('Location: http://www.php.com/index.php');
     or
     <script language='javascript'>window.location("http://www.php.com/index.php");</script>
      

  4.   

    把上一次页面URL记录在SESSION里即可, 点击注册提交表单之后你的php根据session内的记录做一次Location。可以封装一个方法,每个需要记录的页面都调一下以便记录在SESSION里。
      

  5.   

    开启 session 之后 跳转 header location 要跳转到你需要你的页面