Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
2 answers
804 views

Include PHP and CSS files -> relative path

Hello how can I include PHP and CSS files from another directory to the current file? Open Image Include in mathe.php the files from php and css.
Daniel's user avatar
  • 63
0 votes
1 answer
93 views

A href links in PHP include file are not relative to the root

I have a PHP file I am using as the template header for each page of my website. But the links in the PHP template header file are not relative to the root and don't auto update when I create a new ...
Matt Robinson's user avatar
-1 votes
1 answer
79 views

PHP Include relative path - clarification

I have a PHP page on my site in a sub folder called Articles. The page is article.php. The article.php page requires a common php page called _head.php. This provides the header for the pages. _head....
rixtertrader's user avatar
0 votes
1 answer
3k views

C++ Include Relative Paths Broken

I am currently working on a large-scale financial application. There are multiple modules that are compiled separately and then combined in a higher-level makefile. Due to poor design, a lot of the ...
Viktor Zhou's user avatar
1 vote
1 answer
1k views

Scandir relative to the path of file when included?

I have the following code in a file which is included into a host of other pages which require this information. $directory_list = scandir("../packages"); $known_directories = [ ".", ".." ]; $...
Allenph's user avatar
  • 2,015
0 votes
3 answers
125 views

PHP 'include' issue - cannot seem to get include to work correctly

I'm having a spot of bother with php includes. I have the following file structure htdocs index.php login.php php_includes db_conx.php check_user_status.php within the db_conx.php file i've ...
Mobaz's user avatar
  • 595
4 votes
3 answers
22k views

Why are these relative paths not working in php

My app structure is as follows application -> views -> templates // some more files page.php -> controllers ...
wheresrhys's user avatar
  • 23.4k
3 votes
1 answer
289 views

php include statement unable to open stream to file in directory above current directory

I am trying to include a file in a different directory using a relative file path however I keep getting the error: failed to open stream: No such file or directory The path of the file calling the ...
bubster's user avatar
  • 887
2 votes
6 answers
6k views

Absolute (or relative?) path in PHP

Sorry for asking it as it may be answered many times before, but my question is little bit different I have tree like /var/www/path/to/my/app/ -- index.php -- b.php -- inc/ -- ...
genesis's user avatar
  • 50.9k
3 votes
1 answer
19k views

Retrieving relative url path of file inside a include file, jsp

I have a file called Main.jsp, located at the absolute url path of "http://Mywebpage.com/Open/This/Folder/Main.jsp". Inside Main.jsp, there is a jsp include: <%@ include file="../../Top.jsp" %>...
user717236's user avatar
  • 5,019
1 vote
3 answers
884 views

PHP include chain not working

Here's the folder structure of my project: /ping --/Controller ----Ping_Conntroller_Main.php ----Ping_Conntroller_Db.php --/Model ----dbCredentials.php --/View ----output.html.php 'ping' is the ...
Brownbay's user avatar
  • 5,500
0 votes
1 answer
280 views

Include path and weird structure

Hai. I've got site which is really weird, and now is making me troubles. This is simplified structure public_html - adm --- raport ------ raportpdf.php --- class ------ Bonus --------- Bonus_DAO....
Misiur's user avatar
  • 5,277
2 votes
1 answer
680 views

Paths when both including and requesting AJAX

I was wondering if there is a way of making a relative path to the main folder (where the index.php lies) from every file that needs to be included or requested by AJAX. I want to combine both AJAX ...
Cristian's user avatar
  • 6,057
0 votes
2 answers
197 views

Is require '/home/../http/' as fast as require '/http/'?

I know that it is poor performance to use relative paths when including a file in php. But, is this true for for all paths or just paths relative to the assumed (context) include path? Is this line ...
thesmart's user avatar
  • 3,063