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>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ej673
function name:  (null)
number of ops:  47
compiled vars:  !0 = $txtUsername, !1 = $txtPassword1, !2 = $strSQL, !3 = $objQuery, !4 = $objResult, !5 = $username, !6 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    2     2        ECHO                                                     '%3C%21DOCTYPE+html%3E+%0A%3Chtml%3E%0A%3Chead%3E%0A%3Cmeta+charset%3D%22UTF-8%22%3E%0A%3Ctitle%3ECheck+Login%3C%2Ftitle%3E+%0A%0A%0A%3C%2Fhead%3E+%0A%3Cbody%3E+%0A%0A%0A%0A'
   15     3        FETCH_R                      global              ~8      '_POST'
          4        FETCH_DIM_R                                      ~9      ~8, 'txtUsername'
          5        ASSIGN                                                   !0, ~9
   16     6        FETCH_R                      global              ~11     '_POST'
          7        FETCH_DIM_R                                      ~12     ~11, 'txtPassword1'
          8        ASSIGN                                                   !1, ~12
   17     9        INCLUDE_OR_EVAL                                          'connect.php', INCLUDE
   18    10        CONCAT                                           ~15     'SELECT+%2A+FROM+login+WHERE+username+%3D+%27', !0
         11        CONCAT                                           ~16     ~15, '%27+%0Aand+password+%3D+%27'
   19    12        CONCAT                                           ~17     ~16, !1
         13        CONCAT                                           ~18     ~17, '%27'
   18    14        ASSIGN                                                   !2, ~18
   20    15        INIT_FCALL_BY_NAME                                       'mysql_query'
         16        SEND_VAR_EX                                              !2
         17        DO_FCALL                                      0  $20     
         18        ASSIGN                                                   !3, $20
   21    19        INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         20        SEND_VAR_EX                                              !3
         21        DO_FCALL                                      0  $22     
         22        ASSIGN                                                   !4, $22
   22    23        BOOL_NOT                                         ~24     !4
         24      > JMPZ                                                     ~24, ->29
   24    25    >   ECHO                                                     '++++%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A++++alert%28%22%E0%B8%81%E0%B8%A3%E0%B8%B8%E0%B8%93%E0%B8%B2%E0%B8%95%E0%B8%A3%E0%B8%A7%E0%B8%88%E0%B8%AA%E0%B8%AD%E0%B8%9A+Username+%E0%B9%81%E0%B8%A5%E0%B8%B0+Password%22%29%0A++++%3C%2Fscript%3E%0A%0A'
   28    26        ECHO                                                     '%3CMETA+HTTP-EQUIV%3D%27Refresh%27+CONTENT%3D%270%3B+URL%3Dlogin.php%27%3E'
   29    27      > EXIT                                                     
         28*       JMP                                                      ->43
   33    29    >   FETCH_R                      global              ~25     '_POST'
         30        FETCH_DIM_R                                      ~26     ~25, 'txtUsername'
         31        ASSIGN                                                   !5, ~26
   34    32        ECHO                                                     '%3C%21--%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A++++alert%28%22'
   35    33        ECHO                                                     !5
         34        ECHO                                                     '%22+%29%3B%0A%3C%2Fscript%3E--%3E%0A%0A++++'
   39    35        FETCH_W                      global              $28     '_SESSION'
         36        ASSIGN_DIM                                               $28, 'myValue'
         37        OP_DATA                                                  !5
   41    38        ROPE_INIT                                     3  ~31     'Select+%2A+from+login+where+username%3D%27'
         39        ROPE_ADD                                      1  ~31     ~31, !5
         40        ROPE_END                                      2  ~30     ~31, '%27+'
         41        ASSIGN                                                   !6, ~30
   42    42        ECHO                                                     '%3CMETA+HTTP-EQUIV%3D%27Refresh%27+CONTENT%3D%270%3B+URL%3Dmenu2.php%27%3E'
   46    43        INIT_FCALL_BY_NAME                                       'mysql_close'
         44        DO_FCALL                                      0          
   48    45        ECHO                                                     '%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   50    46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.34 ms | 1405 KiB | 15 Q