<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Sharing a global variable between forms</title>
		<link>https://legacy.forums.gravityhelp.com/topic/sharing-a-global-variable-between-forms</link>
		<description>Gravity Support Forums Topic: Sharing a global variable between forms</description>
		<language>en-US</language>
		<pubDate>Thu, 23 Apr 2026 18:23:31 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/sharing-a-global-variable-between-forms" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Sharing a global variable between forms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/sharing-a-global-variable-between-forms#post-41019</link>
			<pubDate>Mon, 14 Nov 2011 10:44:40 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">41019@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Probably Windows.  I would test this in your production environment so you are not trying to solve problems that will not exist when your site goes live.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JimBurke on "Sharing a global variable between forms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/sharing-a-global-variable-between-forms#post-40995</link>
			<pubDate>Mon, 14 Nov 2011 08:09:01 +0000</pubDate>
			<dc:creator>JimBurke</dc:creator>
			<guid isPermaLink="false">40995@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;GOT IT !!!!&#60;/p&#62;
&#60;p&#62;It turns out that Wordpress (on Windows) doesn't use nor want session !&#60;br /&#62;
The solution is to insert an action hook to start a session at init time. Then session variables work !&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.pastie.org/2861239&#34; rel=&#34;nofollow&#34;&#62;http://www.pastie.org/2861239&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;ARGH - is this a feature of all WordPress or just Windows ?&#60;/p&#62;
&#60;p&#62;I am well aware that stateless operation is safest and best. However I have a perfectly good reason here for wanting to persist a value across pages. Why is it so difficult and am I the only one ?&#60;/p&#62;
&#60;p&#62;Thanks anyway Chris.&#60;/p&#62;
&#60;p&#62;Jim
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JimBurke on "Sharing a global variable between forms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/sharing-a-global-variable-between-forms#post-40974</link>
			<pubDate>Sun, 13 Nov 2011 21:21:14 +0000</pubDate>
			<dc:creator>JimBurke</dc:creator>
			<guid isPermaLink="false">40974@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for getting back Chris.&#60;/p&#62;
&#60;p&#62;I too suspect that there's something fundamentally wrong with what I'm doing, but I just can't see it. I've reduced the code to simplify it. Here's 3 snippets.&#60;/p&#62;
&#60;p&#62;#1 - declaration in functions.php, plus get/set routines.&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/2859374&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/2859374&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;#2 - In form #4, after_submission hook (I know this fires)&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/2859453&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/2859453&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;#3: - In form #5; attempt to access the global. Always NULL.&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/2859475&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/2859475&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I'm developing in a VM on a Windows system, so I can't give you a URL to have a proper look.&#60;/p&#62;
&#60;p&#62;Jim
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Sharing a global variable between forms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/sharing-a-global-variable-between-forms#post-40956</link>
			<pubDate>Sun, 13 Nov 2011 16:51:44 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">40956@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Can you post the code you are using to declare the value, then how you are accessing it in each form?  It has to be something with the implementation.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JimBurke on "Sharing a global variable between forms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/sharing-a-global-variable-between-forms#post-40900</link>
			<pubDate>Sat, 12 Nov 2011 11:28:16 +0000</pubDate>
			<dc:creator>JimBurke</dc:creator>
			<guid isPermaLink="false">40900@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Anybody there ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>JimBurke on "Sharing a global variable between forms"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/sharing-a-global-variable-between-forms#post-40491</link>
			<pubDate>Tue, 08 Nov 2011 14:50:13 +0000</pubDate>
			<dc:creator>JimBurke</dc:creator>
			<guid isPermaLink="false">40491@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I want to declare a global - $TournamentID to share between forms on the site. The user can select the TournamentID from a dropdown on Form1 and that is set for the rest of the site until it is changed.&#60;br /&#62;
In the pre_render of each other form I want to use this global to know what data to pull back from the database (MySQL).&#60;/p&#62;
&#60;p&#62;I declare $TournamentID in functions.php and have get and set functions for manipulating the global, to save having to declare the global wherever I need it.&#60;br /&#62;
In Form1, the pre_render can set/get the global value no problem.&#60;br /&#62;
However when I go into the pre_render of Form2, this global is null !&#60;/p&#62;
&#60;p&#62;How/where do I declare this global ?&#60;/p&#62;
&#60;p&#62;I know I can pass parameters in the request and that works fine, but a global would save lots of code and make life so much easier.&#60;/p&#62;
&#60;p&#62;I must be doing something fundamentally wrong because I cannot find anything closely related in here or on the web.&#60;/p&#62;
&#60;p&#62;I'm using PHP on WordPress, both up-to-date. The platform is Windows Server 2003 with IIS.&#60;/p&#62;
&#60;p&#62;Any ideas ?&#60;/p&#62;
&#60;p&#62;Jim
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
