SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Rawalpindi, Pakistan
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,
    I have read some of old posts regarding including the files in virtual paths, got 2 answers, one is add entry in php.ini file, and second is through .htaccess, I need details on both accounts, where can I find php.ini, and what shud I write in .htaccess file.

    Thanx

    Aatif Malik

  2. #2
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What exactly do you want to achieve? If you just want to include a fiel then you can stick it in the same directory as the script you wish to include it in and use
    PHP Code:
    include("filename.txt"); 
    in your PHP script. The include_path and so forth are only important if you wish to keep your include files completely seperate from your main scripts (useful if you include a file in a lot of different scripts or for security when storing database connection details in an included file).

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Rawalpindi, Pakistan
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry ...

    I have header and footer files, I dont want to use different header footer files in different directories, lets say in root directory I'll be using include("header.php"), where in root/first directory I'll be using include("../header.php"), but I want to use same string in all directories, some thing like include virtual in ASP, some body else has asked similar question, thats why I didnt explain,

    Thanx

  4. #4
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry about that - I didn't read the other thread first. You won't be able to edit the php.ini file unless you arethe server administrator (i.e if you are using a hosting account somewhere it's very unlikely you'll be able to change it) - I'm afraid I haven't the slightest idea if or how you could do it with .htaccess though

  5. #5
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IN htaccess:

    php_include_path "/path/to/dir"


    Peter


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •