PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old June 14th, 2002, 12:28 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
access protected folder

Hello,

I am using php in my website. I have a protected folder and php scripts in it. i have a php outside the protected folder also.
How can i access the protected folder using php.
For example - there is a folder reg and inside there a protected folder pr.
username is abc password is 123.
i want when i click on php script it opens a script in folder pr using username and password automatically.

Please help. Thanks

Reply With Quote
  #2  
Old June 14th, 2002, 02:22 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: access protected folder

If you just want to access a file in a protected folder, you can do that without doing anything...just use the file() function or fopen() to open it. Don't use an http:// name, just use a file system name ...like :

$file = file('./pr/somefile.txt');

When you access a file in this way, it goes around .htaccess and the likes...

Reply With Quote
  #3  
Old June 14th, 2002, 02:46 PM
geekmug geekmug is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 8 geekmug User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to geekmug Send a message via AIM to geekmug
RE: access protected folder

I think your verbage means you want to be able to have a link to a protected file. If so, http://user:pass@URL/, would be the format to automatically login as user and pass.

Reply With Quote
  #4  
Old June 16th, 2002, 06:30 PM
sethadam1 sethadam1 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Orlando, FL
Posts: 223 sethadam1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: access protected folder

Actually, the easiest way to do it is like this:

whatever folder your HTML is in, let's call it "public_html" is what apache recognizes as the web root. However, PHP can read anywhere on the server, so a file in the web root could read a file NOT ACCESSIBLE OVER THE INTERNET as long as it's on your server. If your web root is /home/web/public_html, you might put your scripts in /home/web/scripts and call the script like so:

from, let's say, index.php in the root-
php Code:
Original - php Code
  1.  
  2. include{'../scripts/menu.php')



Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > access protected folder


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway