3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?PHP //Connect to DB include ("db_connect.php"); $con; if (!$con){ die('Hata: ' . mysql_error()); } error_reporting(0); session_start(); if (isset($_SESSION['regid'])){ $registerId = $_SESSION['regid'];; }else{ //header("location:index.php"); //$newPage = "index.php"; } // echo "regId: " . $registerId; if (isset($_POST['submit'])){ $join = $_POST['join']; $institution = $_POST['institution']; $program = $_POST['program']; $country = $_POST['country']; $city = $_POST['city']; $date = date("Y-m-d"); var_dump($_POST); if ($join=='noJoin'){ $newPage = "saving.php"; echo "you're free!"; }else if (($institution=='')||($program=='')||($country=='')||($city=='')){//not enough info $error = "Lütfen eksik veya hatalı bilgi olmadığından emin olunuz."; } else { $query = "INSERT into incnet.profilesSummerCampsTemp VALUES ('NULL', '$registerId', '$institution', '$program', '$country', '$city', '$date')"; //echo $query . "<br>"; mysql_query($query); $newPage = "saving.php"; } }?><!doctype html><html> <head> <link rel="shortcut icon" href="../incnet/favicon.ico" > <meta charset="utf-8"> <link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8"> <?PHP if ($newPage!=''){ echo "<meta http-equiv='refresh' content='0; url=saving.php'>"; } ?> <style> .p1 { display:inline-block; } </style> </head> <body OnLoad="document.summerCamps.institution.focus();"> <div class='container'> <div class='titleDiv'> 6. Yaz Programı ve Staj Bilgileri </div><hr> <form name="summerCamps" method='POST' autocomplete='off'> <input type='hidden' name='camp_count' id='campCount' value='1'> <div style='color: #c1272d; font-size:12pt'><?PHP echo $error; ?></div> <input type="checkbox" name="join" value="noJoin" onclick="showHide()">Yaz programına katılmadım.<br> <div id='camps'> <?php for ($camp_count = (isset($_POST["camp_count"]))?$_POST["camp_count"]:1, $loop_count=0; $camp_count>$loop_count; $loop_count++) { $val1 = $institution[$loop_count]; $val2 = $program[$loop_count]; $val3 = $country[$loop_count]; $val4 = $city[$loop_count]; echo " <table class='p1'> <tr> <td>Üniversite/Kurum</td> <td><input type='text' name='institution[]' maxlength='150' onkeypress='return isGoodKey(event)' value='" . $val1 . /*echo $institution;*/ "'></td> </tr><tr> <td>Program</td> <td><input type='text' name='program[]' maxlength='150' onkeypress='return isGoodKey(event)' value='" . $val2 . /* echo $program; */"'></td> </tr><tr> <td>Ülke</td> <td><input type='text' name='country[]' maxlength='40' onkeypress='return isGoodKey(event)' value='" . $val3 . /* echo $country; */"'></td> </tr><tr> <td>Şehir</td> <td><input type='text' name='city[]' maxlength='100' onkeypress='return isGoodKey(event)' value='" . $val4 . /* echo $city; */"'></td> </tr> </table>"; } ?> </div> <input type='submit' name='submit' value='Devam' style='width:120px; height: 40px; font-size:18pt;'> <button type='button' id='addCamp' style='width:165px; height: 40px; font-size:12pt; position:relative; bottom:2px;'>Add Another Camp</button> <br>*Lütfen tüm alanları doldurunuz. </form><br><br> </div><div class="copyright">© INÇNET</div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ $("#addCamp").click(function(){ campCount = $("#campCount").val(); campCount++; $("#campCount").val(campCount); newCamp = "<table class='p1'><tr><td>Üniversite/Kurum</td><td><input type='text' name='institution' maxlength='150' onkeypress='return isGoodKey(event)'></td></tr><tr><td>Program</td><td><input type='text' name='program' maxlength='150' onkeypress='return isGoodKey(event)'></td></tr><tr><td>Ülke</td><td><input type='text' name='country' maxlength='40' onkeypress='return isGoodKey(event)'></td></tr><tr><td>Şehir</td><td><input type='text' name='city' maxlength='100' onkeypress='return isGoodKey(event)'></td></tr></table>"; $('#camps').append(newCamp); }); }); function showHide(){ if ($(".p1").is(":hidden")==true){ $(".p1").css("display", "inline-block"); document.summerCamps.institution.focus(); } else { $(".p1").hide(); } } function isGoodKey(evt){ var charCode = (evt.which) ? evt.which : event.keyCode var charCode = evt.which || evt.keyCode; var charTyped = String.fromCharCode(charCode); var myChars = new Array("A","B","C","Ç","D","E","F","G","Ğ","H","I","İ","J","K","L","M","N","O","Ö","P","R","S","Ş","T","U","Ü","V","Y","Z","1","2","3","4","4","5","6","7","8","9","0",",",":",".","/","a","b","c","ç","d","e","f","g","ğ","h","ı","i","j","k","l","m","n","o","ö","p","r","s","ş","t","u","ü","v","y","z","Q","q","W","w","x","X"," ","@"); if((myChars.indexOf(charTyped) != -1)||charCode==8){ return true; }else{ alert("Bu alana kullandığınız karakterlerle giriş yapılamaz!"); return false; } } </script> </body></html><?php
Output for 5.0.4 - 5.4.32
<!doctype html><html> <head> <link rel="shortcut icon" href="../incnet/favicon.ico" > <meta charset="utf-8"> <link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8"> Notice: Undefined variable: newPage in /in/GEMKa on line 1 <style> .p1 { display:inline-block; } </style> </head> <body OnLoad="document.summerCamps.institution.focus();"> <div class='container'> <div class='titleDiv'> 6. Yaz Programı ve Staj Bilgileri </div><hr> <form name="summerCamps" method='POST' autocomplete='off'> <input type='hidden' name='camp_count' id='campCount' value='1'> <div style='color: #c1272d; font-size:12pt'> Notice: Undefined variable: error in /in/GEMKa on line 1 </div> <input type="checkbox" name="join" value="noJoin" onclick="showHide()">Yaz programına katılmadım.<br> <div id='camps'> Notice: Undefined variable: institution in /in/GEMKa on line 1 Notice: Undefined variable: program in /in/GEMKa on line 1 Notice: Undefined variable: country in /in/GEMKa on line 1 Notice: Undefined variable: city in /in/GEMKa on line 1 <table class='p1'> <tr> <td>Üniversite/Kurum</td> <td><input type='text' name='institution[]' maxlength='150' onkeypress='return isGoodKey(event)' value=''></td> </tr><tr> <td>Program</td> <td><input type='text' name='program[]' maxlength='150' onkeypress='return isGoodKey(event)' value=''></td> </tr><tr> <td>Ülke</td> <td><input type='text' name='country[]' maxlength='40' onkeypress='return isGoodKey(event)' value=''></td> </tr><tr> <td>Şehir</td> <td><input type='text' name='city[]' maxlength='100' onkeypress='return isGoodKey(event)' value=''></td> </tr> </table> </div> <input type='submit' name='submit' value='Devam' style='width:120px; height: 40px; font-size:18pt;'> <button type='button' id='addCamp' style='width:165px; height: 40px; font-size:12pt; position:relative; bottom:2px;'>Add Another Camp</button> <br>*Lütfen tüm alanları doldurunuz. </form><br><br> </div><div class="copyright">© INÇNET</div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ $("#addCamp").click(function(){ campCount = $("#campCount").val(); campCount++; $("#campCount").val(campCount); newCamp = "<table class='p1'><tr><td>Üniversite/Kurum</td><td><input type='text' name='institution' maxlength='150' onkeypress='return isGoodKey(event)'></td></tr><tr><td>Program</td><td><input type='text' name='program' maxlength='150' onkeypress='return isGoodKey(event)'></td></tr><tr><td>Ülke</td><td><input type='text' name='country' maxlength='40' onkeypress='return isGoodKey(event)'></td></tr><tr><td>Şehir</td><td><input type='text' name='city' maxlength='100' onkeypress='return isGoodKey(event)'></td></tr></table>"; $('#camps').append(newCamp); }); }); function showHide(){ if ($(".p1").is(":hidden")==true){ $(".p1").css("display", "inline-block"); document.summerCamps.institution.focus(); } else { $(".p1").hide(); } } function isGoodKey(evt){ var charCode = (evt.which) ? evt.which : event.keyCode var charCode = evt.which || evt.keyCode; var charTyped = String.fromCharCode(charCode); var myChars = new Array("A","B","C","Ç","D","E","F","G","Ğ","H","I","İ","J","K","L","M","N","O","Ö","P","R","S","Ş","T","U","Ü","V","Y","Z","1","2","3","4","4","5","6","7","8","9","0",",",":",".","/","a","b","c","ç","d","e","f","g","ğ","h","ı","i","j","k","l","m","n","o","ö","p","r","s","ş","t","u","ü","v","y","z","Q","q","W","w","x","X"," ","@"); if((myChars.indexOf(charTyped) != -1)||charCode==8){ return true; }else{ alert("Bu alana kullandığınız karakterlerle giriş yapılamaz!"); return false; } } </script> </body></html><?php
Output for 4.3.0 - 5.0.3
<!doctype html><html> <head> <link rel="shortcut icon" href="../incnet/favicon.ico" > <meta charset="utf-8"> <link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8"> Notice: Undefined variable: newPage in /in/GEMKa on line 1 <style> .p1 { display:inline-block; } </style> </head> <body OnLoad="document.summerCamps.institution.focus();"> <div class='container'> <div class='titleDiv'> 6. Yaz Programı ve Staj Bilgileri </div><hr> <form name="summerCamps" method='POST' autocomplete='off'> <input type='hidden' name='camp_count' id='campCount' value='1'> <div style='color: #c1272d; font-size:12pt'> Notice: Undefined variable: error in /in/GEMKa on line 1 </div> <input type="checkbox" name="join" value="noJoin" onclick="showHide()">Yaz programına katılmadım.<br> <div id='camps'> Notice: Undefined variable: institution in /in/GEMKa on line 1 Notice: Undefined variable: program in /in/GEMKa on line 1 Notice: Undefined variable: country in /in/GEMKa on line 1 Notice: Undefined variable: city in /in/GEMKa on line 1 <table class='p1'> <tr> <td>Üniversite/Kurum</td> <td><input type='text' name='institution[]' maxlength='150' onkeypress='return isGoodKey(event)' value=''></td> </tr><tr> <td>Program</td> <td><input type='text' name='program[]' maxlength='150' onkeypress='return isGoodKey(event)' value=''></td> </tr><tr> <td>Ülke</td> <td><input type='text' name='country[]' maxlength='40' onkeypress='return isGoodKey(event)' value=''></td> </tr><tr> <td>Şehir</td> <td><input type='text' name='city[]' maxlength='100' onkeypress='return isGoodKey(event)' value=''></td> </tr> </table> </div> <input type='submit' name='submit' value='Devam' style='width:120px; height: 40px; font-size:18pt;'> <button type='button' id='addCamp' style='width:165px; height: 40px; font-size:12pt; position:relative; bottom:2px;'>Add Another Camp</button> <br>*Lütfen tüm alanları doldurunuz. </form><br><br> </div><div class="copyright">© INÇNET</div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ $("#addCamp").click(function(){ campCount = $("#campCount").val(); campCount++; $("#campCount").val(campCount); newCamp = "<table class='p1'><tr><td>Üniversite/Kurum</td><td><input type='text' name='institution' maxlength='150' onkeypress='return isGoodKey(event)'></td></tr><tr><td>Program</td><td><input type='text' name='program' maxlength='150' onkeypress='return isGoodKey(event)'></td></tr><tr><td>Ülke</td><td><input type='text' name='country' maxlength='40' onkeypress='return isGoodKey(event)'></td></tr><tr><td>Şehir</td><td><input type='text' name='city' maxlength='100' onkeypress='return isGoodKey(event)'></td></tr></table>"; $('#camps').append(newCamp); }); }); function showHide(){ if ($(".p1").is(":hidden")==true){ $(".p1").css("display", "inline-block"); document.summerCamps.institution.focus(); } else { $(".p1").hide(); } } function isGoodKey(evt){ var charCode = (evt.which) ? evt.which : event.keyCode var charCode = evt.which || evt.keyCode; var charTyped = String.fromCharCode(charCode); var myChars = new Array("A","B","C","Ç","D","E","F","G","Ğ","H","I","İ","J","K","L","M","N","O","Ö","P","R","S","Ş","T","U","Ü","V","Y","Z","1","2","3","4","4","5","6","7","8","9","0",",",":",".","/","a","b","c","ç","d","e","f","g","ğ","h","ı","i","j","k","l","m","n","o","ö","p","r","s","ş","t","u","ü","v","y","z","Q","q","W","w","x","X"," ","@"); if((myChars.indexOf(charTyped) != -1)||charCode==8){ return true; }else{ alert("Bu alana kullandığınız karakterlerle giriş yapılamaz!"); return false; } } </script> </body></html><?php