rajups
asked on
bypassing .htaccess for a one file in the directory in PHP application
Hi,
Evevn though my problem is in PHP, but its related to the linux security so i tought that this is the right place to post this query. if not sorry.
i m new to unix / linux env , and i m developing a php application which is running on linux server with apache.
to control the admin files of our application we added a .htaccess file to our admin folder (where all our admin files are located).
but now at one part of my application i need to read the contents of one file in that folder(admin) using fopen , that time because of .htaccess , its not allowing me to that..
so is there any way to pass the user name and password from my php prog to .htacces file, or is it possiable to deny the .htaccess to one particular file in the same folder.
Thanks in advance.
Evevn though my problem is in PHP, but its related to the linux security so i tought that this is the right place to post this query. if not sorry.
i m new to unix / linux env , and i m developing a php application which is running on linux server with apache.
to control the admin files of our application we added a .htaccess file to our admin folder (where all our admin files are located).
but now at one part of my application i need to read the contents of one file in that folder(admin) using fopen , that time because of .htaccess , its not allowing me to that..
so is there any way to pass the user name and password from my php prog to .htacces file, or is it possiable to deny the .htaccess to one particular file in the same folder.
Thanks in advance.
ASKER
hi ahoffmann,
Thanks u r response, but i think u r not clear on my problem.my intention is not to open a physical form, i ned to open a url and read its source , means , i had a php url like "www.myserver.com/.../invoice.php?oid=5", it will generate a invoice for the order no 5.so ineed to open a file with this url, thre by i can get the invoice of order no 5, as a html source, nd i need 2 pass it as an email to the customer.
now the problem is as of its an invoice file, its in admin folder which is controlled by .htaccess file.so when ever i m trying to open this file using fopen(), its not allowing me to open it.
i think now its clear.
thanks in advance.
Raju.P.S
Thanks u r response, but i think u r not clear on my problem.my intention is not to open a physical form, i ned to open a url and read its source , means , i had a php url like "www.myserver.com/.../invoice.php?oid=5", it will generate a invoice for the order no 5.so ineed to open a file with this url, thre by i can get the invoice of order no 5, as a html source, nd i need 2 pass it as an email to the customer.
now the problem is as of its an invoice file, its in admin folder which is controlled by .htaccess file.so when ever i m trying to open this file using fopen(), its not allowing me to open it.
i think now its clear.
thanks in advance.
Raju.P.S
do you mean to use fopen() from another server with the URL as parameter?
ASKER
hi ahoffmann ,
s, exactly and its not like from other server its like from any browser.
can we do that.
s, exactly and its not like from other server its like from any browser.
can we do that.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You dont need your admin directory published in the web, so you dont need to protect it with .htaccess
Try accessing the file using the full path e.g. /home/administrator/files/ admin
If this is located on other machine, consider using samba shares.
Hope this can help a bit.
Try accessing the file using the full path e.g. /home/administrator/files/
If this is located on other machine, consider using samba shares.
Hope this can help a bit.
do you mean PHP's fopen() function?
Then this is not a .htaccess but a php.ini problem, for example open_basedir