日期:2014-05-17  浏览次数:20664 次

目录路径问题
bishe是根目录,里面包含一个
一级目录regist.PHP和control文件夹,index.php
二级目录control文件夹里面包含register.PHP
register.PHP里面跳转语句到index.php

echo "<script>window.location.href='index.php';</script>";

结果实际路径是bishe\control\index.php
我想要的是bishe\index.php
怎么修改?



------解决方案--------------------
echo "<script>window.location.href='../index.php';</script>";
------解决方案--------------------
<script>window.location.href='/index.php';</script>
/index.php 代表在根目录下的index.php
或者: ../index.php 代表在上一层目录下的index.php ,在你的需求中是同一效果

index.php 或 ./index.php 代表在当前目录下的index.php

另,标准的路径分隔符是 / ,不是\
------解决方案--------------------
弄清楚相关路径的问题
./ 同级
../ 上一级