Skip to content

Instantly share code, notes, and snippets.

@cmb69 cmb69/userfuncs.php
Created Nov 7, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.