password protection for parts of a php script / page...

This is a discussion on password protection for parts of a php script / page... within the PHP Language forums, part of the PHP Programming Forums category; Hi Gurus Is there a way you can password protect a particular function/action on a page? What I basically ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-21-2005
WindAndWaves
 
Posts: n/a
Default password protection for parts of a php script / page...

Hi Gurus

Is there a way you can password protect a particular function/action on a page?

What I basically want to do is to have a page and if people click on a button that they are able to edit parts of it.

Obviously I do not want everyone to be able to edit parts of the page, so I would like to prompt for a password so that only
qualifying users can continue...

So, what I have is a PHP script that outputs nice html with a link "edit this page"

then if ($edit = true) .... the user is prompted for a password and if the password is correct, the rest of the PHP script is
executed, where it allows the user to change things (using a form).

Or - would you suggest to place it in a password protected folder and what sort of issues does this pose if I post data (using a
form) to this page in the password protected area?

TIA

- Nicolaas


Reply With Quote
  #2 (permalink)  
Old 01-21-2005
Erwin Moller
 
Posts: n/a
Default Re: password protection for parts of a php script / page...

WindAndWaves wrote:

> Hi Gurus
>
> Is there a way you can password protect a particular function/action on a
> page?
>
> What I basically want to do is to have a page and if people click on a
> button that they are able to edit parts of it.
>
> Obviously I do not want everyone to be able to edit parts of the page, so
> I would like to prompt for a password so that only qualifying users can
> continue...
>
> So, what I have is a PHP script that outputs nice html with a link "edit
> this page"
>
> then if ($edit = true) .... the user is prompted for a password and if the
> password is correct, the rest of the PHP script is executed, where it
> allows the user to change things (using a form).
>
> Or - would you suggest to place it in a password protected folder and what
> sort of issues does this pose if I post data (using a form) to this page
> in the password protected area?
>
> TIA
>
> - Nicolaas


Hi Nic,

Take some time to study SESSION at www.php.net
With Sessions you can easily do such things.

Regards,
Erwin Moller
Reply With Quote
  #3 (permalink)  
Old 01-22-2005
Chung Leong
 
Posts: n/a
Default Re: password protection for parts of a php script / page...

"WindAndWaves" <access@ngaru.com> wrote in message
news:ATXHd.9958$mo2.753462@news.xtra.co.nz...
> Hi Gurus
>
> Is there a way you can password protect a particular function/action on a

page?
>
> What I basically want to do is to have a page and if people click on a

button that they are able to edit parts of it.
>
> Obviously I do not want everyone to be able to edit parts of the page, so

I would like to prompt for a password so that only
> qualifying users can continue...
>
> So, what I have is a PHP script that outputs nice html with a link "edit

this page"
>
> then if ($edit = true) .... the user is prompted for a password and if the

password is correct, the rest of the PHP script is
> executed, where it allows the user to change things (using a form).
>
> Or - would you suggest to place it in a password protected folder and what

sort of issues does this pose if I post data (using a
> form) to this page in the password protected area?


HTTP authentication would require the least amount of work. Read the Apache
manual for more information. The directive you need is probably <Location>.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0