<?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: Redirect to a different page/URL based on form results</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Redirect to a different page/URL based on form results</description>
<language>en</language>
<pubDate>Wed, 06 May 2026 04:32:49 +0000</pubDate>

<item>
<title>demodemo on "Redirect to a different page/URL based on form results"</title>
<link>https://www.machform.com/forums/topic/redirect-to-a-different-pageurl-based-on-form-results#post-5999</link>
<pubDate>Wed, 27 May 2009 23:25:39 +0000</pubDate>
<dc:creator>demodemo</dc:creator>
<guid isPermaLink="false">5999@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;hi mpivon,can you do a function that will display a some parts of a form initially blocked from display using an if else statement
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Redirect to a different page/URL based on form results"</title>
<link>https://www.machform.com/forums/topic/redirect-to-a-different-pageurl-based-on-form-results#post-196</link>
<pubDate>Wed, 31 Oct 2007 15:19:09 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">196@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Thanks for sharing this!&#60;/p&#62;
&#60;p&#62;I've marked this topic as sticky, for easy reference.&#60;br /&#62;
If anyone has useful customization like this one, please feel free to post it.
&#60;/p&#62;</description>
</item>
<item>
<title>mpivon on "Redirect to a different page/URL based on form results"</title>
<link>https://www.machform.com/forums/topic/redirect-to-a-different-pageurl-based-on-form-results#post-195</link>
<pubDate>Wed, 31 Oct 2007 06:27:06 +0000</pubDate>
<dc:creator>mpivon</dc:creator>
<guid isPermaLink="false">195@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;IMPORTANT FYI:  To do this you will need to ALSO modify includes/post-functions.php, insert the code below into line 772, above the query line.&#60;/p&#62;
&#60;p&#62;//post_validation hook&#60;/p&#62;
&#60;p&#62;if(function_exists(&#34;form{$form_id}_hook_post_validation&#34;)){&#60;br /&#62;
	$result = call_user_func(&#34;form{$form_id}_hook_post_validation&#34;,$user_input);&#60;br /&#62;
	if($result !== true){&#60;br /&#62;
		$process_result['custom_error'] = $result;&#60;br /&#62;
	}&#60;br /&#62;
}
&#60;/p&#62;</description>
</item>
<item>
<title>mpivon on "Redirect to a different page/URL based on form results"</title>
<link>https://www.machform.com/forums/topic/redirect-to-a-different-pageurl-based-on-form-results#post-194</link>
<pubDate>Wed, 31 Oct 2007 06:25:05 +0000</pubDate>
<dc:creator>mpivon</dc:creator>
<guid isPermaLink="false">194@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;For those of you that don't know about the custom hooks function, I highly recommend using this to build out your forms with custom functionality.&#60;/p&#62;
&#60;p&#62;Many of you have asked about redirecting forms based on user responses.  This is one hook that you can add to the file &#34;custom_hooks.php&#34; that will accomplish this:&#60;/p&#62;
&#60;p&#62;You can copy and paste the code below and just modify the variables as instructed.&#60;/p&#62;
&#60;p&#62;// Substitute the form number for XXX and the element number for YYY&#60;br /&#62;
// the element number is the form segement that receives information from a user when a&#60;br /&#62;
// form is live.&#60;/p&#62;
&#60;p&#62;function formXXX_hook_post_validation($user_input){&#60;br /&#62;
   $status = $user_input['element_YYY'];&#60;/p&#62;
&#60;p&#62;   // In the statement below, the letter 'Z' needs to be replaced by the value of the&#60;br /&#62;
   // element.  But this can be tricky because radio forms and checkboxes often return&#60;br /&#62;
   // a value like a 1 or a 2.  Make sure you know the value, and&#60;br /&#62;
   // don't confuse this with the form or element 'label'.&#60;/p&#62;
&#60;p&#62;if (strcasecmp($status,&#34;Z&#34;) != 0)&#60;/p&#62;
&#60;p&#62;{&#60;/p&#62;
&#60;p&#62;   // HERE'S THE MONEY STATEMENT&#60;br /&#62;
   // This is the redirect to a webpage - OR another APPFORM that the user fills out&#60;br /&#62;
   // This example illustrates a redirect to a Machform.&#60;/p&#62;
&#60;p&#62;   	$status = &#34;http://www.ANOTHERWEBSITE.com/MACHFORM/view.php?id=6&#34;;&#60;br /&#62;
        header (&#34;Location: $status&#34;);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;  else{&#60;br /&#62;
   	$status = true;&#60;br /&#62;
   }&#60;/p&#62;
&#60;p&#62;   return $status;&#60;br /&#62;
  }&#60;/p&#62;
&#60;p&#62;Note that you must also insert a bit of code into one of the other pages, to make sure this hook is called when the form is loaded.  (See the next post from me...)
&#60;/p&#62;</description>
</item>

</channel>
</rss>
