3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Check Login</title> </head> <body> <? $txtUsername =$_POST['txtUsername']; $txtPassword1 =$_POST['txtPassword1']; include("connect.php"); $strSQL = "SELECT * FROM login WHERE username = '".$txtUsername."' and password = '".$txtPassword1."'"; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); if(!$objResult) { ?> <script type="text/javascript"> alert("กรุณาตรวจสอบ Username และ Password") </script> <? echo "<META HTTP-EQUIV='Refresh' CONTENT='0; URL=login.php'>"; exit(); } else { $username = $_POST['txtUsername']; ?> <!--<script type="text/javascript"> alert("<? echo $username ?>" ); </script>--> <? $_SESSION['myValue']= $username; $sql = "Select * from login where username='$username' "; echo "<META HTTP-EQUIV='Refresh' CONTENT='0; URL=menu2.php'>"; } mysql_close(); ?> </body> </html>
Output for git.master, git.master_jit, rfc.property-hooks
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Check Login</title> </head> <body> <? $txtUsername =$_POST['txtUsername']; $txtPassword1 =$_POST['txtPassword1']; include("connect.php"); $strSQL = "SELECT * FROM login WHERE username = '".$txtUsername."' and password = '".$txtPassword1."'"; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); if(!$objResult) { ?> <script type="text/javascript"> alert("กรุณาตรวจสอบ Username และ Password") </script> <? echo "<META HTTP-EQUIV='Refresh' CONTENT='0; URL=login.php'>"; exit(); } else { $username = $_POST['txtUsername']; ?> <!--<script type="text/javascript"> alert("<? echo $username ?>" ); </script>--> <? $_SESSION['myValue']= $username; $sql = "Select * from login where username='$username' "; echo "<META HTTP-EQUIV='Refresh' CONTENT='0; URL=menu2.php'>"; } mysql_close(); ?> </body> </html>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
46.94 ms | 403 KiB | 8 Q