3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); $host="fenrir"; // Host name $username="x"; // Mysql username $password="x"; // Mysql password $db_name="x"; // Database name $tbl_name="register_users"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myBirthDay=$_POST['myBirthDay']; $myEmail=$_POST['myEmail']; echo $_SESSION['myFirstName'], $_SESSION['myLastName'], $myLastName, $myBirthDay, $myEmail; // To protect MySQL injection (more detail about MySQL injection) $myBirthDay = stripslashes($myBirthDay); $myEmail = stripslashes($myEmail); $myBirthDay = mysql_real_escape_string($myBirthDay); $myEmail = mysql_real_escape_string($myEmail); $sql="INSERT INTO $tbl_name (id, firstName, lastName, birthDay, email) VALUES(0, $myFirstName, $myLastName, $myBirthDay, $myEmail);"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ echo "Success."; } else { echo "Wrong Username or Password"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 47) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 80
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 80
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e9XNH
function name:  (null)
number of ops:  82
compiled vars:  !0 = $host, !1 = $username, !2 = $password, !3 = $db_name, !4 = $tbl_name, !5 = $myBirthDay, !6 = $myEmail, !7 = $myLastName, !8 = $sql, !9 = $myFirstName, !10 = $result, !11 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    3     2        ASSIGN                                                   !0, 'fenrir'
    4     3        ASSIGN                                                   !1, 'x'
    5     4        ASSIGN                                                   !2, 'x'
    6     5        ASSIGN                                                   !3, 'x'
    7     6        ASSIGN                                                   !4, 'register_users'
   10     7        INIT_FCALL_BY_NAME                                       'mysql_connect'
          8        CAST                                          6  ~18     !0
          9        SEND_VAL_EX                                              ~18
         10        CAST                                          6  ~19     !1
         11        SEND_VAL_EX                                              ~19
         12        CAST                                          6  ~20     !2
         13        SEND_VAL_EX                                              ~20
         14        DO_FCALL                                      0  $21     
         15      > JMPNZ_EX                                         ~22     $21, ->18
         16    > > EXIT                                                     'cannot+connect'
         17*       BOOL                                             ~22     <true>
   11    18    >   INIT_FCALL_BY_NAME                                       'mysql_select_db'
         19        CAST                                          6  ~23     !3
         20        SEND_VAL_EX                                              ~23
         21        DO_FCALL                                      0  $24     
         22      > JMPNZ_EX                                         ~25     $24, ->25
         23    > > EXIT                                                     'cannot+select+DB'
         24*       BOOL                                             ~25     <true>
   14    25    >   FETCH_R                      global              ~26     '_POST'
         26        FETCH_DIM_R                                      ~27     ~26, 'myBirthDay'
         27        ASSIGN                                                   !5, ~27
   15    28        FETCH_R                      global              ~29     '_POST'
         29        FETCH_DIM_R                                      ~30     ~29, 'myEmail'
         30        ASSIGN                                                   !6, ~30
   17    31        FETCH_R                      global              ~32     '_SESSION'
         32        FETCH_DIM_R                                      ~33     ~32, 'myFirstName'
         33        ECHO                                                     ~33
         34        FETCH_R                      global              ~34     '_SESSION'
         35        FETCH_DIM_R                                      ~35     ~34, 'myLastName'
         36        ECHO                                                     ~35
         37        ECHO                                                     !7
         38        ECHO                                                     !5
         39        ECHO                                                     !6
   20    40        INIT_FCALL                                               'stripslashes'
         41        SEND_VAR                                                 !5
         42        DO_ICALL                                         $36     
         43        ASSIGN                                                   !5, $36
   21    44        INIT_FCALL                                               'stripslashes'
         45        SEND_VAR                                                 !6
         46        DO_ICALL                                         $38     
         47        ASSIGN                                                   !6, $38
   22    48        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         49        SEND_VAR_EX                                              !5
         50        DO_FCALL                                      0  $40     
         51        ASSIGN                                                   !5, $40
   23    52        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         53        SEND_VAR_EX                                              !6
         54        DO_FCALL                                      0  $42     
         55        ASSIGN                                                   !6, $42
   25    56        ROPE_INIT                                    11  ~45     'INSERT+INTO+'
         57        ROPE_ADD                                      1  ~45     ~45, !4
         58        ROPE_ADD                                      2  ~45     ~45, '+%28id%2C+firstName%2C+lastName%2C+birthDay%2C+email%29+VALUES%280%2C+'
         59        ROPE_ADD                                      3  ~45     ~45, !9
         60        ROPE_ADD                                      4  ~45     ~45, '%2C+'
         61        ROPE_ADD                                      5  ~45     ~45, !7
         62        ROPE_ADD                                      6  ~45     ~45, '%2C+'
         63        ROPE_ADD                                      7  ~45     ~45, !5
         64        ROPE_ADD                                      8  ~45     ~45, '%2C+'
         65        ROPE_ADD                                      9  ~45     ~45, !6
         66        ROPE_END                                     10  ~44     ~45, '%29%3B'
         67        ASSIGN                                                   !8, ~44
   26    68        INIT_FCALL_BY_NAME                                       'mysql_query'
         69        SEND_VAR_EX                                              !8
         70        DO_FCALL                                      0  $52     
         71        ASSIGN                                                   !10, $52
   29    72        INIT_FCALL_BY_NAME                                       'mysql_num_rows'
         73        SEND_VAR_EX                                              !10
         74        DO_FCALL                                      0  $54     
         75        ASSIGN                                                   !11, $54
   33    76        IS_EQUAL                                                 !11, 1
         77      > JMPZ                                                     ~56, ->80
   34    78    >   ECHO                                                     'Success.'
         79      > JMP                                                      ->81
   37    80    >   ECHO                                                     'Wrong+Username+or+Password'
   39    81    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.87 ms | 1400 KiB | 17 Q