SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Non-Member
    Join Date
    Feb 2001
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This doesnt really apply to this forum, but I couldnt find anywhere else to post this question :

    On my site I am using a PHP script, that stores information in 2 text format files (these files and the PHP have to be in the same directory), now I dont want snoopers looking at the contents of these files so I have hidden them behind htaccess.

    Problem is I cant call the php script from a page outside the htaccess without the user having to enter a password (which I dont want, as it defeats the point)

    Any suggestions??

  2. #2
    SitePoint Enthusiast b'vis's Avatar
    Join Date
    Nov 1999
    Location
    Wales
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:

    If in the PHP files you have to specify the name of the text files, for example:

    require "myfile.txt"

    try placing the text file inside a new directory, and changing the name you specify to:

    require "directory/myfile.txt"

    Password protect the new directory.

    I'm sorry if this isn't of much help, but it's the best I can do!
    EthosOnline.com - Creative Online Solutions, Design & Print, Event Management & IT Consultancy

  3. #3
    Non-Member
    Join Date
    Feb 2001
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can see where your going and it looks like the only way I can do what I want. So next question is can a PHP script call a TXT file that is hidden behind htaccess without having to enter a password

  4. #4
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Albany, NY
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It can as long as it is on the same server. Instead of calling it as http://www.yourdomain.com/textfile.txt it looks for it as the /home/whereever/textfile.txt on the server. And since .htaccess only protects file from a web browser, then the script does not require a password.
    John Reyes
    HostRocket.com Support


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
  •