Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-17-2008, 02:52 PM htaccess via php
hiptobesquare's Avatar
Extreme Talker

Posts: 186
Location: London UK
Trades: 0
hi

im sure this is possible but cant seem to find any info in the php.net or through google. i have a password protected folder on my server which id like to gain access to via php, hence allowing a user to retrieve a file from this folder if they have passed the required php validation, but not ever giving them a password to it.

the contents of this folder have to be in a password protected place so people cant retrieve the file by simply typing in a url, php validation alone is not secure enough.

anyone know of any suitable tutorials re this?

thanks

mark m
hiptobesquare is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-17-2008, 03:15 PM Re: htaccess via php
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
If the authentication is not digest-based (usually not the case), you can use the
http://username:_password@url
to provide the username/password pair at the request time.

Those **** smilies !!!
No way to deactivate them !???
Remove the _ before password


If you use the file_open wrappers, it should work.
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 04-17-2008 at 03:16 PM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 04-17-2008, 05:26 PM Re: htaccess via php
hiptobesquare's Avatar
Extreme Talker

Posts: 186
Location: London UK
Trades: 0
thanks for your reply tripy, being new to htaccess functions i have no idea what you mean by 'digest based', and i couldn't get the usernameassword@ working, not because it doesnt work, but because i dont understand it.

i have overcome the problem now by using a php script to copy files from the password protected folder to an unprotected foldr on the server, from there access can be obtained through a url.

thanks again.
hiptobesquare is offline
Reply With Quote
View Public Profile
 
Old 04-18-2008, 03:20 AM Re: htaccess via php
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
What I meant is that, you can bypass the browser authentication dialog by providing the username and password in the url. Take as example that the url http://someserver.com/yadah/boum.txt is password protected. If you must log using user=fred and password=flintstone, then you can access the file with :
Code:
 http://fred:flintstone@somewhere.com/yadah/boum.txt
This will give the username/password to the server along the request, and you won't have the authentication window that appears. As long as the username/password pair is correct, that is.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 04-19-2008, 07:03 AM Re: htaccess via php
Average Talker

Posts: 24
Trades: 0
I don't know what,s you mean and what is reson of your posting.
__________________

Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
Ecobaby is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to htaccess via php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32525 seconds with 12 queries