[SOLVED]
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.
add_filter("gform_pre_render_8", "services_check_serviceid_pre_form");
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["serviceid"])){
echo 'Sorry but there was an issue with your request';
echo '<br><br>';
echo 'Please contact <a href="support@marbellaguide.com">support@marbellaguide.com</a> if you continue to receive this error';
} else {
$whmcsservicesid = $_GET["serviceid"];
// some stuff here to verify the serviceid
//if everything is okay, display the form
echo 'Your Service Reference is: ' .$whmcsservicesid;
return $form;
}
}
Posted 13 years ago on Thursday September 8, 2011 |
Permalink