<?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: Add parameter to advanced embed code</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Add parameter to advanced embed code</description>
<language>en</language>
<pubDate>Mon, 04 May 2026 02:28:56 +0000</pubDate>

<item>
<title>redityo on "Add parameter to advanced embed code"</title>
<link>https://www.machform.com/forums/topic/add-parameter-to-advanced-embed-code#post-8224</link>
<pubDate>Fri, 25 Dec 2009 08:15:07 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">8224@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Hmmm .. do you mean, you need to pass the parameter to email field from advance code ? If so, it's easier to use the SESSION variable for this. First you need to add session variable to your advance embed code like this &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
session_start();
require(&#38;quot;/pathtomachform/machform.php&#38;quot;);
$mf_param[&#38;#39;form_id&#38;#39;] = XXX;
$mf_param[&#38;#39;base_path&#38;#39;] = &#38;#39;basepath&#38;#39;;

// add new parameter
//$mf_param[&#38;#39;email&#38;#39;] = &#38;#39;clientemail&#38;#39;;
$_SESSION[&#38;#39;email_session&#38;#39;] = &#38;#39;clientemail&#38;#39;;

display_machform($mf_param);
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;then edit &#34;view-functions.php&#34; and go to line 208, you'll find this code :&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$element_markup = &#38;lt;&#38;lt;&#38;lt;EOT&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;put these code above that line &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if (!empty($_SESSION[&#38;#39;email_session&#38;#39;]) &#38;#38;&#38;#38;  empty($element-&#38;gt;populated_value[&#38;#39;element_&#38;#39;.$element-&#38;gt;id][&#38;#39;default_value&#38;#39;])) {
	$element-&#38;gt;default_value = $_SESSION[&#38;#39;email_session&#38;#39;];
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>elvar on "Add parameter to advanced embed code"</title>
<link>https://www.machform.com/forums/topic/add-parameter-to-advanced-embed-code#post-8222</link>
<pubDate>Fri, 25 Dec 2009 03:39:45 +0000</pubDate>
<dc:creator>elvar</dc:creator>
<guid isPermaLink="false">8222@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I found the topic about uri parameters in machform and it is very understandable. Super component and super support.&#60;/p&#62;
&#60;p&#62;However I have some UTF problems in the uri parameters and I want to solve it with advanced php embed code (till now I never used normal view of the form - only embed).&#60;/p&#62;
&#60;p&#62;It is easy for me to encode and decode the uri parameters in php. But for doing that I need to easily just add new parameters.&#60;/p&#62;
&#60;p&#62;So, code will be like this:&#60;/p&#62;
&#60;p&#62;&#38;lt;?php&#60;br /&#62;
	require(&#34;/pathtomachform/machform.php&#34;);&#60;br /&#62;
	$mf_param['form_id'] = XXX;&#60;br /&#62;
	$mf_param['base_path'] = 'basepath';&#60;/p&#62;
&#60;p&#62;// add new parameter&#60;br /&#62;
$mf_param['email'] = 'clientemail';&#60;/p&#62;
&#60;p&#62;	display_machform($mf_param);&#60;br /&#62;
?&#38;gt;&#60;/p&#62;
&#60;p&#62;Where exactly I need to change the code in MachForm component to use new parameter (if exist) in the form email field?&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
</item>

</channel>
</rss>
