<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: Password Protect the Form</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Password Protect the Form</description>
<language>en</language>
<pubDate>Sun, 03 May 2026 20:59:01 +0000</pubDate>

<item>
<title>Saghalie on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1491</link>
<pubDate>Fri, 25 Apr 2008 01:55:48 +0000</pubDate>
<dc:creator>Saghalie</dc:creator>
<guid isPermaLink="false">1491@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Yuniar,&#60;/p&#62;
&#60;p&#62;Thanks for the fix!  Everything is working great!  Your service, as always, is awesome!
&#60;/p&#62;</description>
</item>
<item>
<title>Saghalie on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1489</link>
<pubDate>Thu, 24 Apr 2008 11:27:01 +0000</pubDate>
<dc:creator>Saghalie</dc:creator>
<guid isPermaLink="false">1489@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Yuniar,&#60;/p&#62;
&#60;p&#62;-Done..
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1487</link>
<pubDate>Thu, 24 Apr 2008 11:00:54 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">1487@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hmm.. that's odd.&#60;/p&#62;
&#60;p&#62;Can you mail me and send me the following please:&#60;br /&#62;
1) includes/post-functions.php&#60;br /&#62;
2) includes/view-functions.php&#60;br /&#62;
3) The URL to your form so I can try it&#60;/p&#62;
&#60;p&#62;Mail to: yuniar [at] appnitro.com
&#60;/p&#62;</description>
</item>
<item>
<title>Saghalie on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1482</link>
<pubDate>Thu, 24 Apr 2008 10:49:06 +0000</pubDate>
<dc:creator>Saghalie</dc:creator>
<guid isPermaLink="false">1482@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I have Version 1.2.  &#60;/p&#62;
&#60;p&#62;I re-copied the original &#60;strong&#62;includes/view-functions.php&#60;/strong&#62; and still have the same problem.&#60;/p&#62;
&#60;p&#62;Code:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#38;lt;input id=&#34;element_{$element-&#38;gt;id}_1&#34; name=&#34;element_{$element-&#38;gt;id}_1&#34; class=&#34;element text&#34; size=&#34;2&#34; maxlength=&#34;2&#34; value=&#34;{$element-&#38;gt;populated_value['element_'.$element-&#38;gt;id.'_1']['default_value']}&#34; type=&#34;text&#34;&#38;gt; /&#60;br /&#62;
&#60;/code&#62;&#60;br /&#62;
and &#60;strong&#62;includes/view-functions.php&#60;/strong&#62; is the only one of its kind on my server.&#60;/p&#62;
&#60;p&#62;Mashie!&#60;/p&#62;
&#60;p&#62;Saghalie&#60;br /&#62;
&#60;a href=&#34;http://www.beautiful-beginnings.org/&#34; rel=&#34;nofollow&#34;&#62;http://www.beautiful-beginnings.org/&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1477</link>
<pubDate>Thu, 24 Apr 2008 09:56:44 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">1477@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hmm.. that's weird. I didn't get that error here.&#60;br /&#62;
Are you modifying the correct file &#60;strong&#62;includes/post-functions.php&#60;/strong&#62; ?&#60;/p&#62;
&#60;p&#62;The errors come from &#60;strong&#62;includes/view-functions.php&#60;/strong&#62; line 317. What's the code in that line? or you can just send me the file.
&#60;/p&#62;</description>
</item>
<item>
<title>Saghalie on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1473</link>
<pubDate>Thu, 24 Apr 2008 09:39:57 +0000</pubDate>
<dc:creator>Saghalie</dc:creator>
<guid isPermaLink="false">1473@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Thanks for the reply, fixed the code and now I get this error when I &#34;Don't&#34; put a password in.&#60;/p&#62;
&#60;p&#62;Fatal error: Cannot use string offset as an array in &#38;lt;snip&#38;gt;includes\view-functions.php on line 317&#60;/p&#62;
&#60;p&#62;When I put the password in, it works fine.&#60;/p&#62;
&#60;p&#62;Saghalie&#60;br /&#62;
&#60;a href=&#34;http://www.beautiful-beginnings.org&#34; rel=&#34;nofollow&#34;&#62;http://www.beautiful-beginnings.org&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1469</link>
<pubDate>Thu, 24 Apr 2008 08:41:56 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">1469@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Saghalie,&#60;/p&#62;
&#60;p&#62;You are right, this is a &#34;feature&#34;. Ugh.&#60;/p&#62;
&#60;p&#62;Here is how to fix it, edit your &#60;strong&#62;includes/post-functions.php&#60;/strong&#62;, search around line 14-28:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//this function handle password submission and general form submission
if(isset($input[&#38;#39;password&#38;#39;])){ //if there is password input, do validation
	$query = &#38;quot;select count(form_id) valid_password from ap_forms where form_password=&#38;#39;{$input[&#38;#39;password&#38;#39;]}&#38;#39;&#38;quot;;
	$result = do_query($query);
	$row = do_fetch_result($result);
	if(!empty($row[&#38;#39;valid_password&#38;#39;])){
		$process_result[&#38;#39;status&#38;#39;] = true;
		$_SESSION[&#38;#39;user_authenticated&#38;#39;] = $form_id;
	}else{
		$process_result[&#38;#39;status&#38;#39;] = false;
		$process_result[&#38;#39;custom_error&#38;#39;] = &#38;#39;Invalid Password!&#38;#39;;
	}

	return $process_result;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;code&#62;&#60;/code&#62;&#60;br /&#62;
Replace that whole block of code with this one:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//this function handle password submission and general form submission
//check for password requirement
$query = &#38;quot;select form_password from ap_forms where form_id=&#38;#39;$form_id&#38;#39;&#38;quot;;
$result = do_query($query);
$row = do_fetch_result($result);
if(!empty($row[&#38;#39;form_password&#38;#39;])){
	$require_password = true;
}else{
	$require_password = false;
}

//if this form require password and no session has been set
if($require_password &#38;#38;&#38;#38; (empty($_SESSION[&#38;#39;user_authenticated&#38;#39;]) &#124;&#124; $_SESSION[&#38;#39;user_authenticated&#38;#39;] != $form_id)){ 

	$query = &#38;quot;select count(form_id) valid_password from ap_forms where form_id=&#38;#39;{$form_id}&#38;#39; and form_password=&#38;#39;{$input[&#38;#39;password&#38;#39;]}&#38;#39;&#38;quot;;
	$result = do_query($query);
	$row = do_fetch_result($result);

	if(!empty($row[&#38;#39;valid_password&#38;#39;])){
		$process_result[&#38;#39;status&#38;#39;] = true;
		$_SESSION[&#38;#39;user_authenticated&#38;#39;] = $form_id;
	}else{
		$process_result[&#38;#39;status&#38;#39;] = false;
		$process_result[&#38;#39;custom_error&#38;#39;] = &#38;#39;Invalid Password!&#38;#39;;
	}

	return $process_result;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;code&#62;&#60;/code&#62;&#60;br /&#62;
If the above code doesn't quite clear, use this:&#60;br /&#62;
&#60;a href=&#34;http://mf.pastebin.com/f31d151c0&#34; rel=&#34;nofollow&#34;&#62;http://mf.pastebin.com/f31d151c0&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;That should fix this &#34;feature&#34;.&#60;/p&#62;
&#60;p&#62;I'm packing this code into version 2 which should be released next week. So version 2 shouldn't have this &#34;feature&#34; again.&#60;/p&#62;
&#60;p&#62;Thanks for the report.
&#60;/p&#62;</description>
</item>
<item>
<title>Saghalie on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1468</link>
<pubDate>Thu, 24 Apr 2008 08:02:43 +0000</pubDate>
<dc:creator>Saghalie</dc:creator>
<guid isPermaLink="false">1468@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Found another &#34;Feature&#34; with this issue.  &#60;/p&#62;
&#60;p&#62;-- edited by admin ---&#60;br /&#62;
content hidden because this is a bug report.&#60;br /&#62;
shouldn't be available for public. the fix is available below.&#60;br /&#62;
----------------------&#60;/p&#62;
&#60;p&#62;Thanks,&#60;/p&#62;
&#60;p&#62;Wawa Kopa Saghalie&#60;br /&#62;
&#60;a href=&#34;http://www.beautiful-beginnings.org&#34; rel=&#34;nofollow&#34;&#62;http://www.beautiful-beginnings.org&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>Saghalie on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1287</link>
<pubDate>Fri, 04 Apr 2008 14:04:50 +0000</pubDate>
<dc:creator>Saghalie</dc:creator>
<guid isPermaLink="false">1287@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Never Mind.&#60;/p&#62;
&#60;p&#62;I've found the reason.&#60;/p&#62;
&#60;p&#62;If I am still logged in to MachForm on my server and look at the form it lets me in.  Even though I've defined a different password for the form.&#60;/p&#62;
&#60;p&#62;Its a feature!  Not a BUG!&#60;/p&#62;
&#60;p&#62;Thanks,&#60;/p&#62;
&#60;p&#62;Wawa Kopa Saghalie&#60;br /&#62;
&#60;a href=&#34;http://www.beautiful-beginnings.org&#34; rel=&#34;nofollow&#34;&#62;http://www.beautiful-beginnings.org&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>Saghalie on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1285</link>
<pubDate>Fri, 04 Apr 2008 13:50:09 +0000</pubDate>
<dc:creator>Saghalie</dc:creator>
<guid isPermaLink="false">1285@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;The problem is that everyone accessing the form can submit it and add to the database &#60;strong&#62;without&#60;/strong&#62; using a password.&#60;/p&#62;
&#60;p&#62;It doesn't even ask for a password.&#60;/p&#62;
&#60;p&#62;Saghalie&#60;br /&#62;
&#60;a href=&#34;http://www.beautiful-beginnings.org&#34; rel=&#34;nofollow&#34;&#62;http://www.beautiful-beginnings.org&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1284</link>
<pubDate>Fri, 04 Apr 2008 13:46:41 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">1284@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;sorry, I don't really understand what you mean.&#60;/p&#62;
&#60;p&#62;If password protection enabled, all users accessing your form will be required to type in the password.&#60;br /&#62;
If the password is correct, they will be able to submit it and adds everything to the database.
&#60;/p&#62;</description>
</item>
<item>
<title>Saghalie on "Password Protect the Form"</title>
<link>https://www.machform.com/forums/topic/password-protect-the-form#post-1283</link>
<pubDate>Fri, 04 Apr 2008 13:29:28 +0000</pubDate>
<dc:creator>Saghalie</dc:creator>
<guid isPermaLink="false">1283@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I'm trying to use the password protection for the form.  I'm having no success at it.  Is there a problem with the code?  I select the password field, save the form and when I access it, fill in the form and press submit, it still adds everything in the database.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
