User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,493 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,677 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 5085 | Replies: 12
Reply
Join Date: Aug 2004
Posts: 14
Reputation: phpnovice is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
phpnovice phpnovice is offline Offline
Newbie Poster

how to protect webpage

  #1  
Aug 8th, 2004
Hi,

I built a homepage. Some folders/pages should be no-accessible to visitors. Could someone show me a simple php script to do this.

Thanks.

phpnovice :lol:
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Posts: 226
Reputation: PoA is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 6
PoA PoA is offline Offline
Posting Whiz in Training

Re: how to protect webpage

  #2  
Aug 8th, 2004
Use .htaccess and .htpasswd to protect folders

Read more.
http://www.clockwatchers.com/htaccess_tool.html
http://web-bureau.com/modules/bsecure.php

Hope it helps.
Reply With Quote  
Join Date: Aug 2004
Posts: 14
Reputation: phpnovice is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
phpnovice phpnovice is offline Offline
Newbie Poster

Re: how to protect webpage

  #3  
Aug 9th, 2004
Thanks a lot. I am working on it.

phpnovice

Originally Posted by PoA
Use .htaccess and .htpasswd to protect folders

Read more.
http://www.clockwatchers.com/htaccess_tool.html
http://web-bureau.com/modules/bsecure.php

Hope it helps.
Reply With Quote  
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 354
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Rep Power: 6
Solved Threads: 5
Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

Re: how to protect webpage

  #4  
Aug 23rd, 2004
Also I find this handy if I want to completely block users from viewing the contents of a folder; just put deny from all in a .htaccess file to block all users! This is great for a folder that contains include files that are included by other scripts but are never seen directly
Reply With Quote  
Join Date: Aug 2004
Posts: 14
Reputation: phpnovice is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
phpnovice phpnovice is offline Offline
Newbie Poster

Re: how to protect webpage

  #5  
Aug 24th, 2004
Originally Posted by Gary
Also I find this handy if I want to completely block users from viewing the contents of a folder; just put deny from all in a .htaccess file to block all users! This is great for a folder that contains include files that are included by other scripts but are never seen directly

Hi Gary,

Thanks for your help. I tried .htaccess, but it did not work. Once I set it up, I could not access mysql. Any attempt was refused by mysql. I tried different php code, and none of them worked. Then I switched my apache server to abyss server. Now I can easily access mysql. The problem is that abyss appears not support .htaccess. It will be greatly appreciated if you would help me set this protection up.

Thank you very much.

phpnovice
Reply With Quote  
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 354
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Rep Power: 6
Solved Threads: 5
Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

Re: how to protect webpage

  #6  
Aug 24th, 2004
Yep, .htaccess is only for Apache; and that's the only webserver I know, sorry
Reply With Quote  
Join Date: Aug 2004
Posts: 9
Reputation: jayzee is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jayzee jayzee is offline Offline
Newbie Poster

Re: how to protect webpage

  #7  
Aug 25th, 2004
apache is better than abyss... try switching back.
Reply With Quote  
Join Date: Aug 2004
Posts: 177
Reputation: YoungCoder is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
YoungCoder's Avatar
YoungCoder YoungCoder is offline Offline
Junior Poster

Re: how to protect webpage

  #8  
Aug 25th, 2004
With .htaccess a little trick learned is to use:

IndexIgnore *.php

You can use things other than php but basically this hides all files from being seen in a directory if they have a .php extension. You can still open them however, so this should only really be used to hide rather than to block.
Reply With Quote  
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 354
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Rep Power: 6
Solved Threads: 5
Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

Re: how to protect webpage

  #9  
Aug 25th, 2004
Interesting, thanks YoungCoder If I had the time, I would look through the whole Apache doc to learn more things - but sadly, I don't :p
Reply With Quote  
Join Date: Aug 2004
Posts: 177
Reputation: YoungCoder is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
YoungCoder's Avatar
YoungCoder YoungCoder is offline Offline
Junior Poster

Solution Re: how to protect webpage

  #10  
Aug 26th, 2004
Originally Posted by Gary
Interesting, thanks YoungCoder If I had the time, I would look through the whole Apache doc to learn more things - but sadly, I don't :p

That would acctually make quite a nice bedtime read! So when you goto bed after a hard day coding, and are ready to unwind, you can have a nice thorough read! I have done similar before and have acctually dreamt about programming!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 3:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC