3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php include("dbconnect.php"); //PHP-Test //echo "Hallo Test0\r\n"; if(isset($_POST['send'])) { //Test für Button click //echo "Hallo Test1\r\n"; //Varaiablen Wertzuweisungen $clinum = $_POST["clinum"]; $cligender = $_POST["cligender"]; $cliname = $_POST["cliname"]; $clifirstname = $_POST["clifirstname"]; $cliemail = $_POST["cliemail"]; $clipass = $_POST["clipass"]; $clipass1 = $_POST["clipass1"]; //$cliphone = $_POST["cliephone"]; $clieadded = $_POST["cliadded"]; //Test Ausgaben für variablen /* echo "$clinum\r\n"; echo "$cligender\r\n"; echo "$cliname\r\n"; echo "$clifirstname\r\n" ; echo "$cliemail\r\n"; echo "$clipass\r\n"; echo "$clipass1\r\n"; //echo "$cliphone\r\n"; echo "$clibirthdate\r\n"; echo "$cliadded\r\n"; */ //Passwörter verschlüsseln $clipass = md5($clipass); $clipass1 = md5($clipass1); //Test Verschlüsselung //echo $clipass; // wir setzen einen Flag, um Fehler zu registrieren $ok=true; //jetzt werden die Felder überprüft if ( (!(eregi('^[a-z0-9_\.-]+@[a-z0-9_-]+\.[a-z0-9_\.-]+$',$cliemail))) && (strlen($cliemail)>0) || $email=="") { //email-Adresse ist ungültig $err[0]=true; //Fehler merken $ok=false; //Fehlerflag setzen } if (strlen($clipass)<1) // das Passwort muss mindestens 2 Zeichen haben { $err[10]=true; //Fehler merken $ok=false; //Fehlerflag setzen } if (strlen($clipass1)<1) // der Passwort1 muss mindestens 2 Zeichen haben { $err[10]=true; //Fehler merken $ok=false; //Fehlerflag setzen } if (!($clipass == $clipass1)) //Die Passwörter müssen übereinstimmen { $err[10]=true; //Fehler merken $ok=false; //Fehlerflag setzen } if (strlen($cliname)<2) // der Name muss mindestens 2 Zeichen haben { $err[1]=true; //Fehler merken $ok=false; //Fehlerflag setzen } if (strlen($clifirstname)<2) // der Vorname muss mindestens 2 Zeichen haben { $err[2]=true; //Fehler merken $ok=false; //Fehlerflag setzen } /* if (strlen($cliphone)<2) // Die Telefonnummer (privat) muss mindestens 2 Zeichen haben { $err[3]=true; //Fehler merken $ok=false; //Fehlerflag setzen } */ } if (strlen($clibirthdate)<10) // Das Geburtsdatum (Kind) muss mindestens 10 Zeichen haben { $err[8]=true; //Fehler merken $ok=false; //Fehlerflag setzen } //Überprüfen ob E-Mailadresse bereits bekannt $sql = "SELECT email FROM client WHERE cliemail='$cliemail'"; $result = mysqli_query($db, $sql); $scresult = mysqli_num_rows($result); if ($scresult == 1) { //echo "ja"; $ok=false; //Fehlerflag setzen $err[11]=true; } //else echo "nein"; if($ok) { //Auslesen der höchten Kundennummer $sql = "SELECT MAX(clinum) FROM client"; $db_erg = mysqli_query( $db, $sql ); //Ermitteln neue Kundennummer $clinum = $db_erg + 1; $cliadded = date("m.d.Y"); //Schreiben der Daten in die Client Tabelle $sql = "INSERT INTO client ( clinum, cliname, clifirstname, clibirthdate, cliadded, cliemail, clipass, cligender) VALUES ('$clinum', '$cliname', '$clifirstname', '$clibirthdate', '$cliadded', '$cliemail', '$clipass', '$cligender')"; $db_erg = mysqli_query( $db, $sql ); if ( ! $db_erg ) { die('Ung&uuml;ltige Abfrage ' . mysqli_error()); } //EMAIL /* $to = "$email"; $subject = "Anmeldung zum Kinderschwimmen"; $message = "Sehr "; If ($anrede == Frau) { $message .= "geehrte Frau $name,\r\n"; } else { $message .= "geehrter Herr $name,\r\n"; } $message .= "vielen Dank, dass Sie "; If ($kgeschlecht == kw) { $message .= "Ihre Tochter $kvorname $kname"; } else { $message .= "Ihren Sohn $kvorname $kname"; } $message .= " zu unserem Kinderschwimmen Angemeldet haben. Sie werden Informiert, sobald Ihr Kind das ächste auf der Warteschlange ist. Sollten sich Ihre Daten zur Erreichbarkeit ändern, oder Sie das interesse an einem Schwimmkurs bei der DLRG Waldbröl verlieren, können Sie sich bei uns auf der Homepage mit Ihren Benutzerdaten einloggen und Ihre Daten anpassen."; $from = '=?UTF-8?B?'.base64_encode('DLRG Waldbröl e.V.').'?='; $from .= ' <ausbildung@waldbroel.dlrg.de>'; $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-type: text/html; charset=utf-8"; $headers[] = "From:" . $from; mail($to,$subject,$message,implode("\r\n",$headers)); //system.out.println("Mail Sent."); /* //Variablen für Mailprotokoll $to = “$email”; $subject = “Anmeldung zum Kinderschwimmen”; if ($anrede == "Frau") { $message = “Sehr geehrte Frau $vorname $nachname, ”; } $from = “no-reply@waldbroel.dlrg.de”; $headers = “From:” . $from; mail($to,$subject,$message,$headers); //Testausgabe echo “Mail Sent.”; return; */ }; }; ?> <html> <head> <link type="text/css" rel="stylesheet" href="/style.css"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script type="text/javascript">jQuery.noConflict();</script> <!-- Javascript passt Output der Tabellen in der mobilen Version an --> <script type="text/javascript"> var a_key = ""; </script> <script type="text/javascript"> //<![CDATA[ function showBusy() { jQuery("a#busyTrigger").fancybox ({ 'showCloseButton': false 'modal': true }); jQuery("#busyTrigger").click(); return; } //]]> </script> <script language="javascript"> function passwdcheck() { passwd=document.form1.clipass.value; passwd1=document.form1.clipass1.value; //console.log(passwd); if (clipass == "") { document.getElementById("pwhinweis").innerHTML=""; return (false); } //console.log(passwd1); if (clipass1 == "") { document.getElementById("pwhinweis").innerHTML=""; return (false); } //console.log(passwd == passwd1); if(passwd == passwd1) { document.getElementById("pwhinweis").innerHTML="<img src=\"images.jpg\" width=\"20\" height=\"20\">"; document.getElementById("buttonsend").innerHTML="<input type=\"submit\" class=\"submit\" name=\"send\" onklick=\"checkall()\" value=\"Senden!\">"; return (true); } else { document.getElementById("pwhinweis").innerHTML="<img src=\"images(1).jpg\" width=\"20\" height=\"20\">"; //Die Passw&ouml;rter stimmen nicht &uuml;berein! return (false); } } </script> <script language="JavaScript"> function ValidateEmail() { cliemail=document.form1.cliemail.value; if (cliemail == "") { document.getElementById("emhinweis").innerHTML=""; return (false); } if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form1.cliemail.value)) { document.getElementById("emhinweis").innerHTML="<img src=\"images.jpg\" width=\"20\" height=\"20\">"; document.getElementById("buttonsend").innerHTML="<input type=\"submit\" class=\"submit\" name=\"send\" onklick=\"checkall()\" value=\"Senden!\">"; return (true); } document.getElementById("emhinweis").innerHTML="<img src=\"images(1).jpg\" width=\"20\" height=\"20\">"; return (false); } </script> <script language="JavaScript"> function numkey(event) { var characterCode = (event.which) ? event.which : event.keyCode; /*console.log(event.which); console.log(characterCode); console.log(characterCode < 48 || characterCode > 57);*/ if (characterCode < 48 || characterCode > 57) { //console.log(characterCode != 190 && characterCode != 46 && characterCode != 13); if (characterCode != 40 && characterCode != 38 && characterCode != 9 && characterCode != 46 && characterCode != 13 && characterCode != 8 && characterCode != 37 && characterCode != 39 && characterCode != 97 && characterCode != 98 && characterCode != 99 && characterCode != 100 && characterCode != 101 && characterCode != 102 && characterCode != 96 && characterCode != 103 && characterCode != 104 && characterCode != 105) { event.preventDefault(); return false; } } } </script> <script language="JavaScript"> function datekey(event) { var characterCode = (event.which) ? event.which : event.keyCode; /*console.log(event.which); console.log(characterCode); console.log(characterCode < 48 || characterCode > 57);*/ if (characterCode < 48 || characterCode > 57) { //console.log(characterCode != 190 && characterCode != 46 && characterCode != 13); if (characterCode != 190 && characterCode != 40 && characterCode != 38 && characterCode != 9 && characterCode != 46 && characterCode != 13 && characterCode != 8 && characterCode != 37 && characterCode != 39 && characterCode != 97 && characterCode != 98 && characterCode != 99 && characterCode != 100 && characterCode != 101 && characterCode != 102 && characterCode != 96 && characterCode != 103 && characterCode != 104 && characterCode != 105) { event.preventDefault(); return false; } } } </script> <script language="JavaScript"> function textkey(event) { var characterCode = (event.which) ? event.which : event.keyCode; /* console.log(event.which); console.log(characterCode); console.log(characterCode < 65 || characterCode > 90); */ if (characterCode < 65 || characterCode > 90) { //console.log(characterCode == 8); if (characterCode == 8) { return; } //console.log(characterCode == 9); if (characterCode == 9) { return; } //console.log(characterCode == 37); if (characterCode == 37) { return; } //console.log(characterCode == 38); if (characterCode == 38) { return; } //console.log(characterCode == 39); if (characterCode == 39) { return; } //console.log(characterCode == 40); if (characterCode == 40) { return; } //console.log(characterCode == 46); if (characterCode == 46) { return; } //console.log(characterCode == 106); if (characterCode == 106) { return; } //console.log(characterCode == 173); if (characterCode == 173) { return; } //console.log(characterCode == 189); if (characterCode == 189) { return; } event.preventDefault(); return false; } else { return; } } </script> <title> Benutzer Anlegen </title> </head> <body font-family="Arial"> <div id="content" class="ms_full"> <h2>Benutzer Anlegen</h2> <br> <br> <form name="form1" method="POST"> <?php printf( ' <fieldset>'); printf( ' <legend>'); printf( ' Login Daten'); printf( ' </legend>'); printf( ' <div style="clear:both">'); printf( ' <label style="width:11em">'); printf( ' E-Mail '); printf( ' <span style="color:red">'); printf( ' *'); printf( ' </span>'); printf( ' </label>'); ?> <input name="cliemail" value="<?php echo $cliemail;?>" type="text" <?php if(isset($err[0])) echo 'style="border: 2px solid red"';?> <?php if(isset($err[11])) echo 'style="border: 2px solid red"';?> size="30" onchange="ValidateEmail()" maxlength="50"> <?php if(isset($err[11])) echo 'Diese Email-Adresse ist bereits regestriert';?> <?php printf( ' <span id="emhinweis"> </span>'); printf( ' </div>'); printf( ' <div style="clear:both">'); printf( ' <label style="width:11em">'); printf( ' Passwort '); printf( ' <span style="color:red">'); printf( ' *'); printf( ' </span>'); printf( ' </label>'); ?> <input name="clipass" value="" type="password" <?php if(isset($err[10])) echo 'style="border: 2px solid red"';?> size="30" onchange="passwdcheck()" maxlength="50"> <?php printf( ' </div>'); printf( ' <div style="clear:both">'); printf( ' <label style="width:11em">'); printf( ' Passwort wiederholen '); printf( ' <span style="color:red">'); printf( ' *'); printf( ' </span>'); printf( ' </label>'); ?> <input name="clipass1" value="" type="password" <?php if(isset($err[10])) echo 'style="border: 2px solid red"';?> size="30" onchange="passwdcheck()" maxlength="50"> <?php printf( ' <span id="pwhinweis"> </span>'); printf( ' </div>'); printf( ' </fieldset>'); printf( ' <fieldset>'); printf( ' <legend>'); printf( ' Kontaktdaten'); printf( ' </legend>'); printf( ' <div style="clear:both">'); printf( ' <label style="width:11em">'); printf( ' Anrede '); printf( ' <span style="color:red">'); printf( ' *'); printf( ' </span>'); printf( ' </label>'); printf( ' <select name="anrede">'); if ($cligender == 'm') { printf( ' <option value="m" selected="">Herr</option>'); } else { printf( ' <option value="m">Herr</option>'); }; if ($cligender == 'w') { printf( ' <option value="w" selected="">Frau</option>'); } else { if ($cligender == 'm') { printf( ' <option value="w">Frau</option>'); } else { printf( ' <option value="w" selected="">Frau</option>'); } }; printf( ' </select> '); printf( ' </div>'); printf( ' <div style="clear:both">'); printf( ' <label style="width:11em">'); printf( ' Name '); printf( ' <span style="color:red">'); printf( ' *'); printf( ' </span>'); printf( ' </label>'); ?> <input name="cliname" value="<?php echo $cliname;?>" type="text" <?php if(isset($err[1])) echo 'style="border: 2px solid red"';?> size="30" onkeydown="textkey(event)" maxlength="50"> <?php printf( ' </div>'); printf( ' <div style="clear:both">'); printf( ' <label style="width:11em">'); printf( ' Vorname '); printf( ' <span style="color:red">'); printf( ' *'); printf( ' </span>'); printf( ' </label>'); ?> <input name="clifirstname" value="<?php echo $clifirstname;?>" type="text" <?php if(isset($err[2])) echo 'style="border: 2px solid red"';?> size="30" onkeydown="textkey(event)" maxlength="50"> <?php printf( ' </div>'); /* printf( ' <div style="clear:both">'); printf( ' <label style="width:11em">'); printf( ' Telefon privat '); printf( ' <span style="color:red">'); printf( ' *'); printf( ' </span>'); printf( ' </label>'); */ ?> <!-- <input name="telefonp" value="<?php //echo $telefonp;?>" type="text" <?php // if(isset($err[3])) echo 'style="border: 2px solid red"';?> size="30" onkeydown="numkey(event)" maxlength="50"> --> <?php printf( ' </div>'); printf( ' <div style="clear:both">'); printf( ' <label style="width:11em">'); printf( ' Geburtsdatum '); printf( ' <span style="color:red">'); printf( ' *'); printf( ' </span>'); printf( ' </label>'); <input name="clibirthdate" value="<?php echo $clibirthdate;?>" type="text" <?php if(isset($err[8])) echo 'style="border: 2px solid red"';?> size="30" onkeydown="datekey(event)" maxlength="50" placeholder="tt.mm.jjjj"> <?php printf( ' </div>'); printf( ' </fieldset>'); printf( ' <label style="width:11.6em"> </label>'); printf( ' <input type="reset" class="reset" value="Zur&uuml;cksetzen">'); printf( ' <span id="buttonsend"><input type="submit" class="submit" name="send" onklick="" value="Senden!"></span>'); printf( ' <br style="clear:both">'); printf( ' </form>'); printf( ' </div>'); printf( ' </body> '); printf( '</html>'); ?>
Output for 7.0.0
Parse error: syntax error, unexpected '}', expecting end of file in /in/O7ER4 on line 192
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Parse error: syntax error, unexpected '}' in /in/O7ER4 on line 192
Process exited with code 255.