<?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: Passing a URL into a hidden field</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Passing a URL into a hidden field</description>
<language>en</language>
<pubDate>Mon, 04 May 2026 01:41:12 +0000</pubDate>

<item>
<title>yuniar on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-19028</link>
<pubDate>Fri, 23 Aug 2013 06:22:31 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">19028@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;A &#34;404 error&#34; means you have some trouble with the path of your forms.&#60;br /&#62;
Are you familiar with Firebug (plugin for Firefox)?&#60;/p&#62;
&#60;p&#62;Using the Network tool, you can see if your form have the correct path or not.
&#60;/p&#62;</description>
</item>
<item>
<title>klintrudolph on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-19014</link>
<pubDate>Fri, 23 Aug 2013 02:02:11 +0000</pubDate>
<dc:creator>klintrudolph</dc:creator>
<guid isPermaLink="false">19014@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I'm trying the below method:&#60;/p&#62;
&#60;p&#62;	`&#38;lt;script type=&#34;text/javascript&#34;&#38;gt;;&#60;br /&#62;
	var page_submitted_from = document.referrer;&#60;br /&#62;
	var __machform_url = &#34;http://xcitemediaforms.com/embed.php?id=92140&#38;#38;element_7=&#34;+page_submitted_from;&#60;br /&#62;
	var __machform_height = 652;&#60;br /&#62;
	&#38;lt;/script&#38;gt;&#60;br /&#62;
	&#38;lt;div id=&#34;mf_placeholder&#34;&#38;gt;&#38;lt;/div&#38;gt;`&#60;/p&#62;
&#60;p&#62;And I'm getting the error: &#60;/p&#62;
&#60;p&#62;Forbidden&#60;br /&#62;
You don't have permission to access /embed.php on this server.&#60;br /&#62;
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.&#60;br /&#62;
Apache Server at xcitemediaforms.com Port 80&#60;/p&#62;
&#60;p&#62;If I try the below code everything works fine. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
	var page_submitted_from = &#38;#39;testing&#38;#39;; //using a simple string
	var __machform_url = &#38;quot;http://xcitemediaforms.com/embed.php?id=92140&#38;#38;element_7=&#38;quot;+page_submitted_from;
	var __machform_height = 652;
	&#38;lt;/script&#38;gt;
	&#38;lt;div id=&#38;quot;mf_placeholder&#38;quot;&#38;gt;&#38;lt;/div&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I'm trying to access the url of the page the form was submitted from... &#60;/p&#62;
&#60;p&#62;The reason I am using js to set the page submitted from is the above code is inside a php return statement:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php

function my_function() {

	return &#38;#39;

	&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
	var page_submitted_from = document.referrer;
	var __machform_url = &#38;quot;http://xcitemediaforms.com/embed.php?id=92140&#38;#38;element_7=&#38;quot;+page_submitted_from;
	var __machform_height = 652;
	&#38;lt;/script&#38;gt;
	&#38;lt;div id=&#38;quot;mf_placeholder&#38;quot;&#38;gt;&#38;lt;/div&#38;gt;

	&#38;#39;;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks ahead of time.
&#60;/p&#62;</description>
</item>
<item>
<title>klintrudolph on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-18174</link>
<pubDate>Thu, 02 May 2013 23:50:40 +0000</pubDate>
<dc:creator>klintrudolph</dc:creator>
<guid isPermaLink="false">18174@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Turns out it works with both the SERVER_NAME and the URI. There must have been a problem with the WP site I was testing it on. I have tested the  below code and it works just fine.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
            var __machform_url = &#38;#39;http://xcitemediaforms.com/embed.php?id=59210&#38;lt;?php echo &#38;#39;&#38;#38;element_5=&#38;#39;.$_SERVER[&#38;quot;SERVER_NAME&#38;quot;] . $_SERVER[&#38;quot;REQUEST_URI&#38;quot;]; ?&#38;gt;&#38;#39;;
            var __machform_height = 637;
        &#38;lt;/script&#38;gt;
        &#38;lt;div id=&#38;quot;mf_placeholder&#38;quot;&#38;gt;&#38;lt;/div&#38;gt;
        &#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
        &#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://xcitemediaforms.com/js/jquery.ba-postmessage.min.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
        &#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://xcitemediaforms.com/js/machform_loader.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks for the help.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-18154</link>
<pubDate>Wed, 01 May 2013 11:24:55 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">18154@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Yes please, that would be very helpful. Please contact us directly and let us know the details.
&#60;/p&#62;</description>
</item>
<item>
<title>klintrudolph on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-18130</link>
<pubDate>Tue, 30 Apr 2013 00:56:59 +0000</pubDate>
<dc:creator>klintrudolph</dc:creator>
<guid isPermaLink="false">18130@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I didn't see any error messages or warnings - the form just didn't show. If you still want a page to see the code on a live page let me know and I will set it up for you - can give you ftp as well.
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-18121</link>
<pubDate>Mon, 29 Apr 2013 18:35:54 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">18121@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Is it possible for you to post the URL of the page where you embed the form? So that we could see the error message.&#60;br /&#62;
If you don't want to post it here, you can send it via email: customer.service [at] appnitro.com
&#60;/p&#62;</description>
</item>
<item>
<title>klintrudolph on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-18109</link>
<pubDate>Sat, 27 Apr 2013 06:19:18 +0000</pubDate>
<dc:creator>klintrudolph</dc:creator>
<guid isPermaLink="false">18109@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;So the problem was me trying to get the SERVER_NAME as well as the URI. Any ideas why this would block the form from loading? &#60;/p&#62;
&#60;p&#62;It works fine with the code below. Notice I'm just grabbing the URI and not the SERVER_NAME&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
var __machform_url = &#38;#39;http://xcitemediaforms.com/embed.php?id=59210&#38;lt;?php echo &#38;#39;&#38;#38;element_5=&#38;#39;.urlencode($_SERVER[&#38;quot;REQUEST_URI&#38;quot;]); ?&#38;gt;&#38;#39;;
var __machform_height = 637;
&#38;lt;/script&#38;gt;
&#38;lt;div id=&#38;quot;mf_placeholder&#38;quot;&#38;gt;&#38;lt;/div&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://xcitemediaforms.com/js/jquery.ba-postmessage.min.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://xcitemediaforms.com/js/machform_loader.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks for the help!
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-17927</link>
<pubDate>Tue, 09 Apr 2013 05:51:18 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">17927@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Those code snippets should be the same. Try to check the generated code on your browser when you are using the PHP snippet above, is the code the same as the simple string code?&#60;/p&#62;
&#60;p&#62;Also, you might need to enclose the URL with urlencode, like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;var __machform_url = &#38;#39;http://xcitemediaforms.com/embed.php?id=59210&#38;lt;?php echo &#38;#39;&#38;#38;element_5=&#38;#39;.urlencode($_SERVER[&#38;quot;SERVER_NAME&#38;quot;] . $_SERVER[&#38;quot;REQUEST_URI&#38;quot;]); ?&#38;gt;&#38;#39;;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>klintrudolph on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-17911</link>
<pubDate>Fri, 05 Apr 2013 04:02:28 +0000</pubDate>
<dc:creator>klintrudolph</dc:creator>
<guid isPermaLink="false">17911@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I am trying to do something similar, but since this question has been answered, it seems the js embed method is a bit different. I am using mach forms 3.4, the lates version.&#60;/p&#62;
&#60;p&#62;I have a text field (hidden with css, #li_5). I'm trying to set the value of this field with the url like this:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
var __machform_url = &#38;#39;http://xcitemediaforms.com/embed.php?id=59210&#38;lt;?php echo &#38;#39;&#38;#38;element_5=&#38;#39;.$_SERVER[&#38;quot;SERVER_NAME&#38;quot;] . $_SERVER[&#38;quot;REQUEST_URI&#38;quot;]; ?&#38;gt;&#38;#39;;
var __machform_height = 637;
&#38;lt;/script&#38;gt;
&#38;lt;div id=&#38;quot;mf_placeholder&#38;quot;&#38;gt;&#38;lt;/div&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://xcitemediaforms.com/js/jquery.ba-postmessage.min.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://xcitemediaforms.com/js/machform_loader.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The above code doesn't work at all - the form just doesn't show up. &#60;/p&#62;
&#60;p&#62;When I change the code to a simple string for the url parameter 'element_5=test' (below) it works fine. Is there a way to get the URL, as I am trying in the first snippet with PHP? &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
var __machform_url = &#38;#39;http://xcitemediaforms.com/embed.php?id=59210&#38;#38;element_5=test&#38;#39;;
var __machform_height = 637;
&#38;lt;/script&#38;gt;
&#38;lt;div id=&#38;quot;mf_placeholder&#38;quot;&#38;gt;&#38;lt;/div&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://xcitemediaforms.com/js/jquery.ba-postmessage.min.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;
&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;http://xcitemediaforms.com/js/machform_loader.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>dougmarranci on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-14927</link>
<pubDate>Wed, 30 May 2012 02:07:03 +0000</pubDate>
<dc:creator>dougmarranci</dc:creator>
<guid isPermaLink="false">14927@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Perfect!  thanks for the great customer service!
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-14913</link>
<pubDate>Mon, 28 May 2012 19:39:54 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">14913@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi Doug,&#60;/p&#62;
&#60;p&#62;I see that you are using the javascript embed code for version 3.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
var __machform_url = &#38;#39;http://atlantarex.com/machform/embed.php?id=2&#38;#39;;
var __machform_height = 763;
&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Try to change it with this one:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
var __machform_url = &#38;#39;http://atlantarex.com/machform/embed.php?id=2&#38;lt;?php echo &#38;#39;&#38;#38;element_8=&#38;#39;.$_GET[&#38;#39;pname&#38;#39;]; ?&#38;gt;&#38;#39;;
var __machform_height = 763;
&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>dougmarranci on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-14906</link>
<pubDate>Sun, 27 May 2012 05:58:26 +0000</pubDate>
<dc:creator>dougmarranci</dc:creator>
<guid isPermaLink="false">14906@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I am changing from a system where i am using a variable &#34;pname&#34; which I would like to continue using with MachForm.&#60;/p&#62;
&#60;p&#62;This shows up in the url like this: &#60;a href=&#34;http://www.atlantarex.com/contact.php?pname=Marietta-Square-Restaurant-for-Sale&#34; rel=&#34;nofollow&#34;&#62;http://www.atlantarex.com/contact.php?pname=Marietta-Square-Restaurant-for-Sale&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I want to pass the variable to a form on a page in my root directory which is on this page: &#60;a href=&#34;http://www.atlantarex.com/contact.php&#34; rel=&#34;nofollow&#34;&#62;http://www.atlantarex.com/contact.php&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Here is the code for the field that I want to pre-populate:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;/li&#38;gt;
		&#38;lt;li id=&#38;quot;li_8&#38;quot; &#38;gt;
		&#38;lt;label class=&#38;quot;description&#38;quot; for=&#38;quot;element_8&#38;quot;&#38;gt;Property &#38;lt;/label&#38;gt;
		&#38;lt;div&#38;gt;
			&#38;lt;input id=&#38;quot;element_8&#38;quot; name=&#38;quot;element_8&#38;quot;  class=&#38;quot;element text medium&#38;quot; type=&#38;quot;text&#38;quot; value=&#38;quot;&#38;quot;   /&#38;gt;

		&#38;lt;/div&#38;gt; 

and:  &#38;lt;form id=&#38;quot;form_2&#38;quot;&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Best regards,&#60;br /&#62;
Doug
&#60;/p&#62;</description>
</item>
<item>
<title>Edken on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-12370</link>
<pubDate>Thu, 28 Jul 2011 01:06:17 +0000</pubDate>
<dc:creator>Edken</dc:creator>
<guid isPermaLink="false">12370@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;This confused me too. Im looking for a way to see if my form has been filled out on my website or on my Facebook page. Its the same form but visible from two places.&#60;/p&#62;
&#60;p&#62;I was thinking the best way to do what I want is to repopulate a hidden field with either a predefined value (such as &#34;Facebook&#34;) or the URL of the page used to access the form. (But this might be tricky as my Facebook page accesses the forms direct URL through an iFrame.&#60;/p&#62;
&#60;p&#62;any help would be great.
&#60;/p&#62;</description>
</item>
<item>
<title>lamina on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-12101</link>
<pubDate>Sat, 04 Jun 2011 04:28:35 +0000</pubDate>
<dc:creator>lamina</dc:creator>
<guid isPermaLink="false">12101@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi, did you get this figured out?  I have looked at the two suggested posts and can't for the life of me see what I need to do?&#60;br /&#62;
Any help would be appreciated.&#60;br /&#62;
Regards&#60;br /&#62;
Richard
&#60;/p&#62;</description>
</item>
<item>
<title>redityo on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-11045</link>
<pubDate>Sun, 12 Dec 2010 10:26:24 +0000</pubDate>
<dc:creator>redityo</dc:creator>
<guid isPermaLink="false">11045@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;It's possible to parse the url variable into your form field. To do this, you can use the method that posted in here :&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.appnitro.com/forums/topic/adding-hidden-variables-to-machforms#post-5131&#34; rel=&#34;nofollow&#34;&#62;http://www.appnitro.com/forums/topic/adding-hidden-variables-to-machforms#post-5131&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;or&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.appnitro.com/forums/topic/dynamic-content-php?replies=12&#34; rel=&#34;nofollow&#34;&#62;http://www.appnitro.com/forums/topic/dynamic-content-php?replies=12&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Then you can put this css code into your form to hide the field&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;#li_1 {
display:none !important;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Don't forget to change the id's with yours
&#60;/p&#62;</description>
</item>
<item>
<title>jccj45 on "Passing a URL into a hidden field"</title>
<link>https://www.machform.com/forums/topic/passing-a-url-into-a-hidden-field#post-11044</link>
<pubDate>Sat, 11 Dec 2010 22:50:14 +0000</pubDate>
<dc:creator>jccj45</dc:creator>
<guid isPermaLink="false">11044@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Is there anyway for my form to capture the webpage (URL) it was submitted from. This would be a great feature when running different ad campaigns.... i.e. &#60;a href=&#34;http://www.abc-widgets.com/item1&#34; rel=&#34;nofollow&#34;&#62;www.abc-widgets.com/item1&#60;/a&#62;  I would love to see this URL (or item1) inside my form that was submitted.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
