Simple password protection for forms

Sometimes, you would want to restrict your form to a limited set of users. Only those who have a password can submit the form.

Here is an extension module to password protect your form.

Usage:

Download the extension module.

Open the file pwdprotect.php in any text editor (like Notepad)

Edit the user name/passwords. The format is like this: 'username'=>'password'

[php]

function PasswordProtect()

{

//username => password

$this->logins = array('pmj'=>'p',

'prasanth'=>'sim');

}

[/php]

In Simfatic Forms, Enable 'Extension Modules' (Form processing options page)

In the 'Extension modules' page, press the 'Add module' button and select your updated pwdprotect.php file

Re-upload the form

Now, when you open the form page, your browser will show a box asking for username and password

request password dialog box

Good Article? Share it! Please?

Comments

My entry above stripped the sample code will try again:

I used the following code with the standard PHP start and finish and without the //'s

//session_start();

//session_unset();

//session_destroy();

//$_SESSION = array();

Using pwdprotect.php and it works great but for the life me cannot get the session to log off and re prompt for the password unless I close the browser.

tried the following:

does not appear to work.

Anyone know to do this?

I edited the .php file to

//andrew => moneybot

but when I upload it to the site and it asks for a username and password that doesn't seem to be accepted. Any ideas?

It's great. One of the reasons I chose Simfatic Forms is because it has a no-nonsense business-like approach. No sarcastic or annoyingly-cute comments like another form software. This password-protect is easy to use and works perfectly. No nonsense.

Could not display contact form

Great software

wo this is such a great sharing , and good for those kind of entry needed for secure office work . thanks alot for the great sharing!