PHP How to header-location to a page in a parent directory?

前端 未结 3 1427
不思量自难忘°
不思量自难忘° 2021-01-17 17:14

I have a first.php page with

header(\"Location: script/script1.php\")

and script1.php has another



        
3条回答
  •  伪装坚强ぢ
    2021-01-17 17:44

    have a try with this:

    header("Location: ../first.php")
    

    or use an absolute path or url instead.

    Explanation: .. is the unix/linux expression used for 'parent directory'. The Internet is unix land, so that rules applies there too.

提交回复
热议问题