我有两个php文件,一个文件在子文件夹里面,我想去外面的php文件

I am having two php files one file is inside the subfolder i want to go outside php file. for this purpose i'm using header header("Location:order.php"); but this says url not found.

try this to go one folder up we use ../ prior to the filename

header("Location:../order.php");

In PHP you are always placed at the currently working directory....

ie . the Place your PHP file is present...

TO run/include a file present in another place you have to provide its path along with it's name.

There are two options

  1. You can provide the absolute FilePath Eg. /home/user/phpfiles/file.php

  2. If you want to access something in the Parent or the Subfolders...You can make use of the (.) and (..) operators that point to the current and the parent directory respectively...

Your Problem Can be Solved by using

header("Location: ../order.php");