Skip to content

Instantly share code, notes, and snippets.

@cmb69
Created November 7, 2018 15:17
Show Gist options
  • Save cmb69/5eb5d59ed73b77b40edd4b7a1d3ac2ff to your computer and use it in GitHub Desktop.
Save cmb69/5eb5d59ed73b77b40edd4b7a1d3ac2ff to your computer and use it in GitHub Desktop.
MHZ Weiterleitung
<?php
/**===================================
* Checkbox und danach anklickbarer Button
*====================================*/
function checkbox()
{
if (isset($_POST['checkbox_submit'], $_POST['checkbox_agree'])) {
$_SESSION['checkbox_agreed'] = true;
}
if (isset($_SESSION['checkbox_agreed'])) {
echo newsbox('VERSTECKTE_SEITE');
} else {
return '<form id="checkbox" name="checkbox" action="" method="POST">'
. 'Ich habe diese Informationen zur Kenntnis genommen'
. '<input type="checkbox" id="checkbox_agree" name="checkbox_agree">'
. '<label for="checkbox_agree">und werde mich daran halten.</label>'
. '<button type="submit" class="submit" name="checkbox_submit">'
. 'Ich bin Lehrer/in und arbeite in Klassen mit Inklusion.<br>'
. '<strong> Ich halte mich daran, dass ich diese Materialien <br>'
. 'nur für unterrichtliche Zwecke der HHS nutze.</strong>'
. '</button>'
. '</form>';
}
}
function checkbox_agreed()
{
if (isset($_SESSION['checkbox_agreed'])) {
return;
}
header('Location:' . CMSIMPLE_URL . '?IB-Materialien');
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment