3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // nepřihlášený uživatel je přesměrován na přihlašovací stránku session_start(); if (!$_SESSION ["username"]) { Header ("Location:login.php"); exit; } include "db.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs"> <head> <meta http-equiv="content-type" content="text/html;charset=windows-1250" /> <meta name="robots" content="noindex" /> <link rel="stylesheet" type="text/css" media="all" href="admin.css" /> <title>Soupisy</title> </head> <body> <div id="adminPage"> <div id="content"> <div id="contentLeft"> <?php include "admin_menu.php"; ?> </div> <!-- end contentLeft --> <div id="contentRight"> <?php if (isset($_REQUEST['odeslano']) && $_REQUEST['odeslano'] && !empty($_FILES['data']['tmp_name'])) { if (move_uploaded_file($_FILES['data']['tmp_name'], "./veta.txt")) { $soubor = $_SERVER['DOCUMENT_ROOT'] . "/veta.txt"; $klika = fopen($soubor, 'r'); echo $soubor."<br />"; while (!feof ($klika)) { $radek = fgets($klika, 100); $typ_veta = substr($radek, 0, 1); $carovykod_veta = substr($radek, 1, 13); $postarazitko_veta = substr($radek, 14, 6); $datumpodani_veta = substr($radek, 20, 10); $castka_veta = substr($radek, 30, 8); $var_veta = substr($radek, 47, 4); echo "<p>"; echo $typ_veta; echo " | "; echo $carovykod_veta; echo " | "; echo $postarazitko_veta; echo " | "; echo $datumpodani_veta; echo " | "; echo $castka_veta; echo " | "; echo $var_veta; echo "</p>"; $sql = "INSERT INTO veta VALUES (0, $typ_veta, $carovykod_veta, $postarazitko_veta, $datumpodani_veta, $castka_veta, $var_veta)"; mysql_query($sql); } fclose ($klika); ?> <p> 1. <strong>Nahrát soupis:</strong> <form method="POST" ENCTYPE="multipart/form-data" action="<?echo $_SERVER["PHP_SELF"]?>" style="width:371px;padding:10px;background:#f6fbfd;"> <input type="file" name="data" /> <input type="hidden" name="odeslano" value="1" /> <input type="submit" value="Odeslat" style="width:120px;height:30px;" /> </form> </p> <?php echo "<p>"; $sql = "SELECT * FROM veta"; $vystup = mysql_query($sql); if (!mysql_num_rows($vystup)) { echo "<div style=\"color:#5daa25;\">Tabulka je prázdná.</div>"; $plno = 1; } echo "<p>2. <strong>Obsah tabulky:</strong></p>"; while ($data = mysql_fetch_array($vystup)) { echo $data['$typ_veta'].", ". $data['$carovykod_veta'].", ". $data['$postarazitko_veta'].", ". $data['$datumpodani_veta']."<br />"; } if ($plno != 1) { echo " <a href=\"$PHP_SELF?akce=vyprazdnit\">Vyprázdnit tabulku</a></p>"; } ?> </div> <!-- end contentRight --> </div> <!-- end content --> </div> <!-- end adminPage --> </body> </html>
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected end of file in /in/J6TpU on line 110
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/J6TpU on line 110
Process exited with code 255.