<?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: Dynamic content (PHP)</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Dynamic content (PHP)</description>
<language>en</language>
<pubDate>Sun, 03 May 2026 20:57:55 +0000</pubDate>

<item>
<title>frankzobitz on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/3#post-23825</link>
<pubDate>Tue, 11 Aug 2015 22:08:54 +0000</pubDate>
<dc:creator>frankzobitz</dc:creator>
<guid isPermaLink="false">23825@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Is this what you need?  &#60;a href=&#34;http://www.appnitro.com/doc-url-parameters&#34; rel=&#34;nofollow&#34;&#62;http://www.appnitro.com/doc-url-parameters&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>adrearubin on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/3#post-23821</link>
<pubDate>Tue, 11 Aug 2015 21:18:00 +0000</pubDate>
<dc:creator>adrearubin</dc:creator>
<guid isPermaLink="false">23821@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi, I'm looking to do the same thing where I pass an element from the URL to a hidden field; ?title=name_of_book to element_24.  Does the rules above still apply?  I couldn't find the code above in the lines mentioned, but i do find them elsewhere.  &#60;/p&#62;
&#60;p&#62;Thank you.
&#60;/p&#62;</description>
</item>
<item>
<title>Radices on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/3#post-11428</link>
<pubDate>Tue, 15 Feb 2011 23:50:48 +0000</pubDate>
<dc:creator>Radices</dc:creator>
<guid isPermaLink="false">11428@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Thanks Yuniar I slogged through it myself and got it working. For others ..this appends the email addy from the current form (id=2) to the redirect url which is another form(id=1). &#60;/p&#62;
&#60;p&#62;post-functions.php&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$process_result[&#38;#39;form_redirect&#38;#39;]  = $form_redirect . &#38;#39;&#38;#38;email=&#38;#39; . $table_data[&#38;#39;element_2&#38;#39;];&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;where element_2 is the email field in the current form.&#60;/p&#62;
&#60;p&#62;You then need to edit your view-functions.php file to accept the added parameter and populate the desired field again in my case the email addy.&#60;/p&#62;
&#60;p&#62;On line 1682 you will find this code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$element[$j]-&#38;gt;default_value = htmlspecialchars($row[&#38;#39;element_default_value&#38;#39;]);

Right below that line, add this code:

if($form_id == 1 &#38;#38;&#38;#38; $row[&#38;#39;element_id&#38;#39;] == 2){
	$element[$j]-&#38;gt;default_value = $_GET[&#38;#39;email&#38;#39;];
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Again you need to edit the form_id and element_id numbers to match your &#34;receiving&#34; or redirected form.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/3#post-11424</link>
<pubDate>Tue, 15 Feb 2011 17:57:27 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">11424@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Radices -- You'll need to do some extra coding to pass the email from your first form to the second form.&#60;br /&#62;
Please contact us directly: customer.service [at] appnitro.com&#60;/p&#62;
&#60;p&#62;and let me know the URL to both of your forms.&#60;br /&#62;
We'll help you with the code for this.
&#60;/p&#62;</description>
</item>
<item>
<title>Radices on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-11419</link>
<pubDate>Tue, 15 Feb 2011 03:54:58 +0000</pubDate>
<dc:creator>Radices</dc:creator>
<guid isPermaLink="false">11419@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi, Sorry I'm not getting this exactly.&#60;/p&#62;
&#60;p&#62;I have Form id=1 that has many elements including 'email'.&#60;br /&#62;
I want to create a new form id=2 with just one element to collect the users email addy and pass that to form 1 using the redirect url or other method.&#60;/p&#62;
&#60;p&#62;The idea is to have the user input their email to gain access to the main form but not have to re-enter it when they get there.&#60;/p&#62;
&#60;p&#62;I'm running version 2.3
&#60;/p&#62;</description>
</item>
<item>
<title>DeadLikeMe on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-11107</link>
<pubDate>Wed, 22 Dec 2010 01:47:40 +0000</pubDate>
<dc:creator>DeadLikeMe</dc:creator>
<guid isPermaLink="false">11107@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hello,&#60;br /&#62;
ive got a question,&#60;/p&#62;
&#60;p&#62;i am displaying my form using the Advance Code which i placed into a php page&#60;/p&#62;
&#60;p&#62;i added this:&#60;br /&#62;
&#60;code&#62;&#60;br /&#62;
	&#38;lt;?php&#60;br /&#62;
	require(&#34;/srv/www/vhosts/httpdocs/mail/machform.php&#34;);&#60;br /&#62;
	$mf_param['form_id'] = 3;&#60;br /&#62;
	$mf_param['base_path'] = 'http://www.domain.com/mail/';&#60;br /&#62;
        $mf_param['element_1'] = '&#38;lt;?php echo $slname; ?&#38;gt;';&#60;br /&#62;
	display_machform($mf_param);&#60;br /&#62;
?&#38;gt;&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;I wanted to autofill the first Field of my Form with the username of my member. so i added &#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
$mf_param['element_1'] = '&#38;lt;?php echo $slname; ?&#38;gt;';&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;to my advanced code.&#60;/p&#62;
&#60;p&#62;then, how someone posted i edited view-functions.php&#60;br /&#62;
and put after line 1682&#60;/p&#62;
&#60;p&#62;if($_GET['id'] == 5){&#60;/p&#62;
&#60;p&#62;	if(!empty($_GET['first'])){&#60;br /&#62;
		$element-&#38;gt;populated_value['element_'.$element-&#38;gt;id.'_1']['default_value'] = trim($_GET['first']);&#60;br /&#62;
	}&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;but my form field stays empty :(&#60;/p&#62;
&#60;p&#62;how can i pass the username into the form?
&#60;/p&#62;</description>
</item>
<item>
<title>Trowar on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10841</link>
<pubDate>Thu, 11 Nov 2010 00:54:42 +0000</pubDate>
<dc:creator>Trowar</dc:creator>
<guid isPermaLink="false">10841@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;You must link to the form from another page using that link (http://www.mysite.com/demo/view.php?id=5&#38;#38;email=test@example.com) and then the form will take the email address from the link.&#60;/p&#62;
&#60;p&#62;What are you trying to achieve exactly?&#60;/p&#62;
&#60;p&#62;If you manually add &#38;#38;email=test@example.com and it auto populates then the code is working as intended.
&#60;/p&#62;</description>
</item>
<item>
<title>dexter666 on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10840</link>
<pubDate>Thu, 11 Nov 2010 00:40:14 +0000</pubDate>
<dc:creator>dexter666</dc:creator>
<guid isPermaLink="false">10840@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Yes that one I did, thanks. and I know it works because when I add manually &#38;#38;email=test@example.com to the url the email filed populates. But at the end of that post, Yuniar said:&#60;/p&#62;
&#60;p&#62;&#34;Of course you will need to adjust those form id and element id number.&#34;&#60;/p&#62;
&#60;p&#62;How to change the id form to display in the url like this &#60;a href=&#34;http://www.mysite.com/demo/view.php?id=5&#38;#38;email=test@example.com,&#34; rel=&#34;nofollow&#34;&#62;http://www.mysite.com/demo/view.php?id=5&#38;#38;email=test@example.com,&#60;/a&#62; instead of this: &#60;a href=&#34;http://www.mysite.com/demo/view.php?id=5&#34; rel=&#34;nofollow&#34;&#62;http://www.mysite.com/demo/view.php?id=5&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thanks in advance Trowar!
&#60;/p&#62;</description>
</item>
<item>
<title>Trowar on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10837</link>
<pubDate>Wed, 10 Nov 2010 17:15:02 +0000</pubDate>
<dc:creator>Trowar</dc:creator>
<guid isPermaLink="false">10837@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Reply to dexter666&#60;/p&#62;
&#60;p&#62;You ADD the three lines to view-functions.php below the line:&#60;/p&#62;
&#60;p&#62;$element[$j]-&#38;gt;default_value = htmlspecialchars($row['element_default_value']);&#60;/p&#62;
&#60;p&#62;Lines to enter:&#60;/p&#62;
&#60;p&#62;$form_id == &#38;lt;FORM ID HERE&#38;gt; &#38;#38;&#38;#38; $row['element_id'] == &#38;lt;ELEMENT ID HERE&#38;gt;){&#60;br /&#62;
$element[$j]-&#38;gt;default_value = $_GET['email'];&#60;br /&#62;
}&#60;br /&#62;
If you are having difficulty, maybe you should tell us what you are trying to achieve and provide your form/element numbers. That way we can post the answers for you with no amendments required.
&#60;/p&#62;</description>
</item>
<item>
<title>dexter666 on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10836</link>
<pubDate>Wed, 10 Nov 2010 15:08:17 +0000</pubDate>
<dc:creator>dexter666</dc:creator>
<guid isPermaLink="false">10836@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Where do I change the form id?&#60;/p&#62;
&#60;p&#62;Quoting this post:&#60;/p&#62;
&#60;p&#62;&#34;Hi sk,&#60;/p&#62;
&#60;p&#62;I'll try to help you with this.&#60;/p&#62;
&#60;p&#62;Let's take a sample with this form:&#60;br /&#62;
&#60;a href=&#34;http://www.appnitro.com/demo/view.php?id=5&#34; rel=&#34;nofollow&#34;&#62;http://www.appnitro.com/demo/view.php?id=5&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Let say our goal is to populate the email field, so the url would be like this:&#60;br /&#62;
&#60;a href=&#34;http://www.appnitro.com/demo/view.php?id=5&#38;#38;email=test@example.com&#34; rel=&#34;nofollow&#34;&#62;http://www.appnitro.com/demo/view.php?id=5&#38;#38;email=test@example.com&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Now, our form_id is 5 and the email input field is having id element_3 (view source to see it).&#60;/p&#62;
&#60;p&#62;So, what you need to do is, edit your view-functions.php file, on line 1682 you will find this code:&#60;/p&#62;
&#60;p&#62;$element[$j]-&#38;gt;default_value = htmlspecialchars($row['element_default_value']);&#60;/p&#62;
&#60;p&#62;Right below that line, add this code:&#60;/p&#62;
&#60;p&#62;if($form_id == 5 &#38;#38;&#38;#38; $row['element_id'] == 3){&#60;br /&#62;
	$element[$j]-&#38;gt;default_value = $_GET['email'];&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Save the file and you should be all set.&#60;br /&#62;
Of course you will need to adjust those form id and element id number.&#60;/p&#62;
&#60;p&#62;I hope I'm being clear for you. Feel free to post any questions. &#34;
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10640</link>
<pubDate>Thu, 14 Oct 2010 07:01:59 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">10640@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'm afraid it won't be possible to put PHP code into the default value from within the admin panel.&#60;/p&#62;
&#60;p&#62;However, this can be done by doing a hardcode into the PHP file.&#60;br /&#62;
It is pretty much similar as the modification posted on the first page.&#60;/p&#62;
&#60;p&#62;Let me know what do you need exactly, and I'll show you the code.
&#60;/p&#62;</description>
</item>
<item>
<title>chicagowebmanagement on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10637</link>
<pubDate>Wed, 13 Oct 2010 04:18:29 +0000</pubDate>
<dc:creator>chicagowebmanagement</dc:creator>
<guid isPermaLink="false">10637@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'm trying to do something similar here, and if I could add PHP as 'default' text, I'd be done.&#60;/p&#62;
&#60;p&#62;So, Is there a way to populate text fields with a  default value to show PHP such as echo $_SERVER['QUERY_STRING'];
&#60;/p&#62;</description>
</item>
<item>
<title>ano on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10620</link>
<pubDate>Sat, 09 Oct 2010 05:16:59 +0000</pubDate>
<dc:creator>ano</dc:creator>
<guid isPermaLink="false">10620@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Here is the universal/generic code for pre-populating drop down lists. In include/view-functions.php look for this line:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$option_markup .= &#38;quot;&#38;lt;option value=\&#38;quot;{$option-&#38;gt;id}\&#38;quot; {$selected}&#38;gt;{$option-&#38;gt;option}&#38;lt;/option&#38;gt;\n&#38;quot;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;ABOVE that line add the following code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$select = str_replace(&#38;#39; &#38;#39;, &#38;#39;_&#38;#39;, $element-&#38;gt;title);
if (isset($_GET[$select]) &#38;#38;&#38;#38; $option-&#38;gt;option == $_GET[$select]){
$selected = &#38;#39;selected=&#38;quot;selected&#38;quot;&#38;#39;;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Remember spaces get replaced with underscores. So for example in a form with id 1 and a field called Email To you would have:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#60;a href=&#34;http://yourwebaddress/machform/view.php?id=1&#38;#38;Email_To=your@emailaddress.com&#34; rel=&#34;nofollow&#34;&#62;http://yourwebaddress/machform/view.php?id=1&#38;#38;Email_To=your@emailaddress.com&#60;/a&#62;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;to pre-populate the Email To field with &#60;a href=&#34;mailto:your@emailaddress.com.&#34;&#62;your@emailaddress.com.&#60;/a&#62; The same principal can be applied to checkboxes and radio buttons.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10527</link>
<pubDate>Wed, 22 Sep 2010 17:08:49 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">10527@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;There are no other parameters available for the advanced code other than the form id and the base path.&#60;/p&#62;
&#60;p&#62;If you would like to add another custom parameters, you can simply pass it into the $mf_param array.&#60;/p&#62;
&#60;p&#62;Something like:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$mf_param[&#38;#39;my_new_param&#38;#39;] = &#38;#39;this is my custom parameters&#38;#39;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;You can then use this param within the &#34;display_machform()&#34; function, which is located inside machform.php file.
&#60;/p&#62;</description>
</item>
<item>
<title>zerokom on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10520</link>
<pubDate>Tue, 21 Sep 2010 20:35:35 +0000</pubDate>
<dc:creator>zerokom</dc:creator>
<guid isPermaLink="false">10520@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;When using the Advanced Form Code (PHP), how do I pass the additional parameters to machform?&#60;/p&#62;
&#60;p&#62;&#38;lt;?php&#60;br /&#62;
    require(&#34;/foo.bar/machform/machform.php&#34;);&#60;br /&#62;
    $mf_param['form_id'] = 6;&#60;br /&#62;
    $mf_param['base_path'] = 'http://foo.bar/machform/';&#60;br /&#62;
    display_machform($mf_param);&#60;br /&#62;
?&#38;gt;&#60;/p&#62;
&#60;p&#62;The only parameter passed with the Advanced Form Code appears to be that of the form_id
&#60;/p&#62;</description>
</item>
<item>
<title>Trowar on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-10318</link>
<pubDate>Mon, 30 Aug 2010 17:17:07 +0000</pubDate>
<dc:creator>Trowar</dc:creator>
<guid isPermaLink="false">10318@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Just a note for anyone else that does not realise this (Took me a while to figure it out). If you are using the Advanced Form Code to integrate you form into your site then you must add yuniar's code at around line 2023 in view_functions.php and not at line 1682.&#60;/p&#62;
&#60;p&#62;You still place your code exactly below the line:&#60;br /&#62;
$element[$j]-&#38;gt;default_value = htmlspecialchars($row['element_default_value']);&#60;/p&#62;
&#60;p&#62;So &#60;/p&#62;
&#60;p&#62;Line 1682 for external forms and line 2023 for Advanced Form Code.&#60;/p&#62;
&#60;p&#62;I know the previous post says pretty much the same thing but this is an idiots guide for any other people like me that read this thread.
&#60;/p&#62;</description>
</item>
<item>
<title>shaungummere on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-9116</link>
<pubDate>Sat, 03 Apr 2010 01:48:10 +0000</pubDate>
<dc:creator>shaungummere</dc:creator>
<guid isPermaLink="false">9116@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Thanks, yuniar. I found that I had only added bkonia's universal code to the display_form function but it also needed to be added to the display_integrated_form function on line 2020. Seems to be working as expected now!
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-9113</link>
<pubDate>Fri, 02 Apr 2010 13:50:09 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">9113@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi shaun,&#60;/p&#62;
&#60;p&#62;As my reply above, if you are embedding the form using the php include (advanced form code) instead of the iframe code, then it would depends on your current system/cms.&#60;/p&#62;
&#60;p&#62;Your current CMS might filtered those parameters, hence MachForm didn't get it.&#60;br /&#62;
The easiest way is to use the iframe code to embed the form.
&#60;/p&#62;</description>
</item>
<item>
<title>shaungummere on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-9110</link>
<pubDate>Fri, 02 Apr 2010 04:58:20 +0000</pubDate>
<dc:creator>shaungummere</dc:creator>
<guid isPermaLink="false">9110@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'm not sure if this thread is still active, but I'm having the same issue that markjames is having above. The fields will fill in properly on the standalone form (the view.php page) but once embeded via php include into another page, only the name fields will fill in. Any help would be much appreciated!
&#60;/p&#62;</description>
</item>
<item>
<title>M202A1 on "Dynamic content (PHP)"</title>
<link>https://www.machform.com/forums/topic/dynamic-content-php/page/2#post-7327</link>
<pubDate>Thu, 17 Sep 2009 06:14:46 +0000</pubDate>
<dc:creator>M202A1</dc:creator>
<guid isPermaLink="false">7327@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Can you guys show examples of what you are working on?
&#60;/p&#62;</description>
</item>

</channel>
</rss>
