<?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: How to check parameter before form loads</title>
		<link>https://legacy.forums.gravityhelp.com/topic/how-to-check-parameter-before-form-loads</link>
		<description>Gravity Support Forums Topic: How to check parameter before form loads</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Apr 2026 23:50:16 +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/how-to-check-parameter-before-form-loads" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "How to check parameter before form loads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-check-parameter-before-form-loads#post-34799</link>
			<pubDate>Thu, 08 Sep 2011 09:10:53 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">34799@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks again for posting your solution.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>craigedmonds on "How to check parameter before form loads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-check-parameter-before-form-loads#post-34795</link>
			<pubDate>Thu, 08 Sep 2011 06:48:46 +0000</pubDate>
			<dc:creator>craigedmonds</dc:creator>
			<guid isPermaLink="false">34795@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;[SOLVED]&#60;/p&#62;
&#60;p&#62;I have solved my issue by using the code below. I am tweaking the code more but thought I would update just to say I had found a solution, before anyone answers.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_pre_render_8&#38;quot;, &#38;quot;services_check_serviceid_pre_form&#38;quot;);

function services_check_serviceid_pre_form($form){

	//we need to check with the whmcs database for a valid service id as we only want to allow access to the form for clients who have have a valid and paid invoice

	//check if serviceid parameter exists and if not, redirect
	if(empty($_GET[&#38;quot;serviceid&#38;quot;])){

		echo &#38;#39;Sorry but there was an issue with your request&#38;#39;;
		echo &#38;#39;&#38;lt;br&#38;gt;&#38;lt;br&#38;gt;&#38;#39;;
		echo &#38;#39;Please contact &#38;lt;a href=&#38;quot;support@marbellaguide.com&#38;quot;&#38;gt;support@marbellaguide.com&#38;lt;/a&#38;gt; if you continue to receive this error&#38;#39;;

	} else {

		$whmcsservicesid = $_GET[&#38;quot;serviceid&#38;quot;];
// some stuff here to verify the serviceid

	//if everything is okay, display the form
	echo &#38;#39;Your Service Reference is: &#38;#39; .$whmcsservicesid;
	return $form;

	}

}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>craigedmonds on "How to check parameter before form loads"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-check-parameter-before-form-loads#post-34793</link>
			<pubDate>Thu, 08 Sep 2011 06:23:22 +0000</pubDate>
			<dc:creator>craigedmonds</dc:creator>
			<guid isPermaLink="false">34793@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I want to pass a parameter to the GF EG: &#38;amp;serviceid=999 and check against another database for the serviceid.&#60;/p&#62;
&#60;p&#62;If the serviceid is valid then we can load the form, if not, then we need to redirect to another page.&#60;/p&#62;
&#60;p&#62;Probbaly I will need to use a hook for this but which one?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
