Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Path to file

Status
Not open for further replies.

ralphiooo

Programmer
Oct 23, 2005
64
GB
Hi, i'm following this tutorial:


to make my site mobile friendly. I don't have the time to do it manually so this method seems pretty good. The trouble i'm having is the bit where it says to place:

php_value auto_prepend_file /localfilepath/global_prepend.php
php_value auto_append_file /localfilepath/global_append.php

in my .htaccess file. I have added the code but i'm not sure what to change the localfilepath part to. For testing purposes i am hosted on a windows but online i have a unix server. Ideally i'd like to get it working on both but don't know how to get the path to the files. Appreciate the help. Thanks
 
You can place these files anywhere which all the pages you wish to use it can access it.

Probably the best place to put them is in the same directory as your index.html equivelent.

If you need to find the filesystems path to this directory.
(c:\server\htdocs\index.html) (/home/root/htdocs/index.html)
instead of the HTML path to the file (
You can put the following into a php file in the same directory.

Code:
<?php
  //This will print the directory of a file
  echo "localfilepath = ".getcwd()
?>


Try to learn something about everything and everything about something.
--- Thomas H. Huxley
 
Hi cheers, i placed a file in the same folder as the global_prepend and global_append files and ran the function you said which gave me:

U:\My Webs\Scripts\

So i placed the following in my .htaccess file:

php_value auto_prepend_file U:\My Webs\Scripts\global_prepend.php
php_value auto_append_file U:\My Webs\Scripts\global_append.php

but it returned a 500 internal server error.

Appreciate the help once more. Thanks
 
Worked it out now just had to put quotes around the path. Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top