Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
26 views

Using of include in accessing file from different directory

I've been wondering this lately, why is my files on pages>role_pages>admin display the bootstrap links from the includes>links files, all the pages in my admin folder has design, my login ...
klaus21's user avatar
  • 45
1 vote
1 answer
58 views

Get included file real path

I have a project with the following structure: .credentials helpers.php home.php admin\ login.php register.php In the helpers.php, i'm trying to get the content of .credentials by doing ...
Alberto's user avatar
  • 12.8k
0 votes
1 answer
931 views

How to define path for subfolder

I'm learning PHP and I'm having problems with the definition of the path. If in the settings.php file located in the main folder I define a constant with the base path of the site to be able to use ...
BIKAPPA2 A Vaccari  T Sossi's user avatar
0 votes
2 answers
113 views

PHP include works but can not call variables or functions within the included file

I am trying to set-up a structure for my application to properly include scripts across various pages and subdirectories The issue I am having; inside my index.php I have define ('BASE_URL', 'http:...
eleven0's user avatar
  • 371
5 votes
2 answers
931 views

PHP - Is there any concern with using $_SERVER['DOCUMENT_ROOT'] . "pathname" on every page that needs to include another file?

Due to path issues, I changed my php site to have the following statement at least once on each page: include($_SERVER['DOCUMENT_ROOT'] . "/path/file.php"); Are there any concerns (mainly security) ...
heyitsmyusername's user avatar
0 votes
1 answer
45 views

How do I set a search path for non existing php files in current directory?

Title is pretty much self explanatory... I need to do the same thing in php as dos do with the command : path %windir%/whateverdirectory so iow <?php //if file is NOT exists on the current ...
Steven's user avatar
  • 249
1 vote
2 answers
50 views

Opening file php

Supposing I have a file called "utils.php" where I open a file for writing or reading: $myfile="myfile.txt"; $fileout=fopen($myfile,'w') or die("Not opened"); Now if I have another script UNDER ...
Cornelia Secelean's user avatar
-1 votes
3 answers
137 views

Included file's root path

how can i get "included file's root path" ? d:\projects\project1\incs\inc.php : In this file below line gives me "d:\projects\project1\incs" <?php echo __DIR_; ?> I want to get "/projects/...
Cem's user avatar
  • 856
7 votes
4 answers
16k views

php include_once path

I am trying to find a way to make the include_once(); path start from the beginning directory and then find the path e.g. instead of ../../../path/to/file I would have /path/to/file. If I do do that /...
Frank's user avatar
  • 1,864
2 votes
2 answers
2k views

PHP: Can include a file that file_exists() says doesn't exist

In my script, I set the include path (so another part of the application can include files too), check that a file exists, and include it. However, after I set the include path, file_exists() reports ...
zanbaldwin's user avatar
  • 1,009