How to not show form when $_GET values are not present?

Hide a ChronoForms form when specific URL parameters are missing.

Overview

The form was incorrectly displaying because the code used to check for GET parameters would halt all PHP processing, resulting in a blank page.
Use the ChronoForms Event Switcher action to conditionally display the form only when the required GET values are present, otherwise, perform an alternative action like showing a message.

Answered
hu huubs 17 Feb, 2020
Hello,

I want to not show my form when there are no $_GET values present. I got it somehow working with the following code, but die() obviously stops all PHP processing which means a blank page with my text printed on it. Is there some sort of way to not render the form?
<?php

$date = $_GET['date'];


if($date != ''){
$form->data['date'] = $date;
} else {
echo "No GET values present";
die();
}

?>
Gr GreyHead 17 Feb, 2020
Answer
Hi huubs,

You can use an Event Switcher action to either Display the form - or do something else.

Bob
This topic is locked and no more replies can be posted.