Saturday, 15 June 2013

php - include works only when file is in same directory -


I do this site which I am doing when I include a php file from the same folder, But when I

  & lt ;? Includes Php ('/ ioanblog / appstore / header.php') ;? & Gt;   

This does not work or

    

This is not working either.

If all the header are holding a style sheet and Piwik code, it will also keep navigation. > Enter image details here

Read on the relative path.

If a path is defined ??? Whether full (starting with a drive letter or on Windows, or on the / Unix / Linux system) or relative to the current directory (.or ..) ???? The included_path will be completely ignored, for example, if the file name starts with somebody, the requester will look in the parser to find the file in the original directory.

Are you using / ioanblog / â ?? Which is a Full path I suspect on your site / var / www / public_html / ioanblog / â ?? | or / home / user / ioanblog / â ?? | or something similar, no in / ioanblog / â ?? | You should first create a relative in place of a full path instead of / for the actual file you have .. / contents / header.php < You may have to go "up" in the original directories such as / code> or ../../content / header.php .

Because it should probably be ../../ header.php . But first make sure that you understand the absolute / relative path!

You may also want to read the full paths to change the 'relative path'.

No comments:

Post a Comment