Jump to content

password protect


enahs

Recommended Posts

Hi,

 

Is there a way to password protect an individual form in a webpage.

 

For instance, lets say I have a page with two forms. Lets call one "info" and "additional info". Is there an easy way to make it such that in order to edit say the information in the "info" form, the user would have to enter a password first.

 

This might seem odd, but it is in a complicated database application and I wish to do it this way for various reasons.

 

 

Link to comment
https://forums.phpfreaks.com/topic/107887-password-protect/
Share on other sites

Hmmm... I've never heard of this before BUT....

 

You could create a form that could take a user submitted password, and then if it's correct it would load the same page over again with a $_POST['password'] field set, and then you can display the form like this:

 

 
<?php
?>
FORM1
<?php
if(isset($_POST['pass'])){
?>
FORM2
<?
}
?>
/code]

Don't know how secure that would be though.

Link to comment
https://forums.phpfreaks.com/topic/107887-password-protect/#findComment-553048
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.