3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<script language="javascript" type="text/javascript"> function clearText(field) { if (field.defaultValue == field.value) field.value = ''; else if (field.value == '') field.value = field.defaultValue; } </script> <?php session_start(); $datum = date("d/m/Y H:i:s"); $vs = Time(); $meno = $_POST['meno']; $priezvisko =$_POST['priezvisko']; $cislo = $_POST['cislo']; $email = $_POST['email']; $ico = $_POST['ico']; $dic = $_POST['dic']; $adresa = $_POST['adresa']; $mesto= $_POST['mesto']; $psc= $_POST['psc']; $sprava = $_POST['sprava']; $cena = $_SESSION['total']; $meno_faktura = $_POST['meno_faktura']; $priezvisko_faktura =$_POST['priezvisko_faktura']; $cislo_faktura = $_POST['cislo_faktura']; $email_faktura = $_POST['email_faktura']; $ico_faktura = $_POST['ico_faktura']; $dic_faktura = $_POST['dic_faktura']; $adresa_faktura = $_POST['adresa_faktura']; $mesto_faktura = $_POST['mesto_faktura']; $psc_faktura = $_POST['psc_faktura']; $sprava_faktura = $_POST['sprava_faktura']; $cena = $_SESSION['total']; $_SESSION['zbozi'][$nazov_normal] = $quantity; require 'phpmailerautoload.php'; $mail = new PHPMailer; $mail->Charset = "utf-8"; $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'registracia.herb.vyziva@gmail.com'; // SMTP username $mail->Password = 'pavolpuskar'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted $mail->From = 'objednavky.herb-vyziva.eu'; $mail->FromName = 'Herb-Vyživa'; $mail->addAddress('objednavky@herb-vyziva.eu', 'Herb Vyziva'); // Add a recipient $mail->AddCC($email); $mail->WordWrap = 50; // Set word wrap to 50 characters $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'Vaša objednávka číslo:' .$vs. ' z Herb-Vyziva.eu'; $mail->Body = " <html><body> <table width='100%'> <tr> <td width='60%'>Variabilný symbol</td> <td>$vs</td> </tr> <tr> <td width='60%'>Dátum a čas</td> <td width='40%'>$datum</td> </tr> <tr> <td colspan='2'>Na tento e-mail <strong>neodpovedajte</strong>.</td> </tr> <tr> <td></td> </tr> <tr> <td colspan='2' style='border: 1px solid #cacaca;'>Kontaktné informácie</td> </tr> <tr> <td width='60%'>Meno</td> <td width='40%'>$meno</td> </tr> <tr> <td width='60%'>Priezvisko</td> <td width='40%'>$priezvisko</td> </tr> <tr> <td width='60%'>Telefónne číslo</td> <td width='40%'>$cislo</td> </tr> <tr> <td width='60%'>E-mail</td> <td width='40%'>$email</td> </tr> <tr> <td width='60%'>IČO</td> <td width='40%'>$ico</td> </tr> <tr> <td width='60%'>DIČ</td> <td width='40%'>$dic</td> </tr> <tr> <td colspan='2' style='border: 1px solid #cacaca;'>Adresa na doručenie</td> </tr> <tr> <td width='60%'>Ulica, číslo</td> <td width='40%'>$adresa</td> </tr> <tr> <td width='60%'>Mesto:</td> <td width='40%'>$mesto</td> </tr> <tr> <td width='60%'>PSČ</td> <td width='40%'>$psc</td> </tr> <tr> <td colspan='2' style='border: 1px solid #cacaca;'>Fakturačná adresa</td> </tr> <tr> <td width='60%'>Meno</td> <td width='40%'>$meno_faktura</td> </tr> <tr> <td width='60%'>Priezvisko</td> <td width='40%'>$priezvisko_faktura</td> </tr> <tr> <td width='60%'>Telefónne číslo</td> <td width='40%'>$cislo_faktura</td> </tr> <tr> <td width='60%'>E-mail</td> <td width='40%'>$email_faktura</td> </tr> <tr> <td width='60%'>IČO</td> <td width='40%'>$ico_faktura</td> </tr> <tr> <td width='60%'>DIČ</td> <td width='40%'>$dic_faktura</td> </tr> <tr> <td width='60%'>Ulica, číslo</td> <td width='40%'>$adresa_faktura</td> </tr> <tr> <td width='60%'>Mesto:</td> <td width='40%'>$mesto_faktura</td> </tr> <tr> <td width='60%'>PSČ</td> <td width='40%'>$psc_faktura</td> </tr> <tr> <td width='60%'>Správa</td> <td width='40%'>$sprava_faktura</td> </tr> <tr> <td></td> </tr> <tr> <td colspan='2' style='border: 1px solid #cacaca;'>Objednávka</td> </tr> <tr> <td></td> </tr> <tr> <td width='60%'>Tovar</td> <td width='40%'>Počet ks</td> </tr> <tr> <td width='60%'> <? "; foreach($_SESSION['zbozi'] as $index => $value){ echo $index."<br>"; } echo"</td> <td width='40%'>"; foreach($_SESSION['zbozi'] as $index => $value){ echo $value."<br>"; } echo"</td> </tr> <tr> <td width='60%'>Celková cena objednávky</td> <td width='40%'>$cena</td> </tr> </table> </body> </html>"; "; ?> if (!$meno || !$priezvisko || !$cislo || !$email || !$adresa || !$mesto || !$psc) { echo 'Formulár nebol odoslaný. Skontrolujte si, prosím, vypísanie všetkých políčok a skúste to znova.'; echo '<a href="?strana=dokoncit">Späť na formulár</a>'; } elseif(!$mail->send()) { echo 'Formulár nebol odoslaný. Skontrolujte si, prosím, vypísanie všetkých políčok a skúste to znova.'; echo '<a href="?strana=dokoncit">Späť na formulár</a>'; echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Vaša objednávka bola odoslaná. V krátkej dobe Vás bude kontaktovať administrátor.'; } ?>
based on WJ8A1
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.31
Parse error: syntax error, unexpected '=' in /in/AbkjJ on line 205
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '=' in /in/AbkjJ on line 205
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/AbkjJ on line 205
Process exited with code 255.