3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('DB_HOST', 'localhost'); define('DB_NAME', 'client_registration'); define('DB_USER','lunaone'); define('DB_PASSWORD','lunaone'); $con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error()); $db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error()); function NewUser() { $firstName = $_POST['first_name']; $lastName = $_POST['last_name']; $companyName = $_POST['company_name']; $phoneNumber = $_POST['phone_number']; $email = $_POST['email_address']; $password = $_POST['password']; $query = "INSERT INTO WebsiteUsers (firstName,lastName,companyName,phoneNumber,email_address,password) VALUES ('$irstName','$lastName''$companyName','$phoneNumber','$email_address','$password')"; $data = mysql_query ($query)or die(mysql_error()); if($data) { echo "YOUR REGISTRATION IS COMPLETED..."; } } function SignUp() { if(!empty($_POST['user'])) //checking the 'user' name which is from Sign-Up.html, is it empty or have some text { $query = mysql_query("SELECT * FROM WebsiteUsers WHERE email_address = '$_POST[email_address]' AND password = '$_POST[password]'") or die(mysql_error()); if(!$row = mysql_fetch_array($query) or die(mysql_error())) { newuser(); } else { echo "SORRY...YOU ARE ALREADY REGISTERED USER..."; } } } if(isset($_POST['submit'])) { SignUp(); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 26, Position 2 = 31
Branch analysis from position: 26
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 47) Position 1 = 38, Position 2 = 43
Branch analysis from position: 38
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 48
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
filename:       /in/7TocM
function name:  (null)
number of ops:  49
compiled vars:  !0 = $con, !1 = $db
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'DB_HOST'
          2        SEND_VAL                                                 'localhost'
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'DB_NAME'
          6        SEND_VAL                                                 'client_registration'
          7        DO_ICALL                                                 
    5     8        INIT_FCALL                                               'define'
          9        SEND_VAL                                                 'DB_USER'
         10        SEND_VAL                                                 'lunaone'
         11        DO_ICALL                                                 
    6    12        INIT_FCALL                                               'define'
         13        SEND_VAL                                                 'DB_PASSWORD'
         14        SEND_VAL                                                 'lunaone'
         15        DO_ICALL                                                 
    8    16        INIT_FCALL_BY_NAME                                       'mysql_connect'
         17        FETCH_CONSTANT                                   ~6      'DB_HOST'
         18        SEND_VAL_EX                                              ~6
         19        FETCH_CONSTANT                                   ~7      'DB_USER'
         20        SEND_VAL_EX                                              ~7
         21        FETCH_CONSTANT                                   ~8      'DB_PASSWORD'
         22        SEND_VAL_EX                                              ~8
         23        DO_FCALL                                      0  $9      
         24        ASSIGN                                           ~10     !0, $9
         25      > JMPNZ_EX                                         ~10     ~10, ->31
         26    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         27        DO_FCALL                                      0  $11     
         28        CONCAT                                           ~12     'Failed+to+connect+to+MySQL%3A+', $11
         29      > EXIT                                                     ~12
         30*       BOOL                                             ~10     <true>
    9    31    >   INIT_FCALL_BY_NAME                                       'mysql_select_db'
         32        FETCH_CONSTANT                                   ~13     'DB_NAME'
         33        SEND_VAL_EX                                              ~13
         34        SEND_VAR_EX                                              !0
         35        DO_FCALL                                      0  $14     
         36        ASSIGN                                           ~15     !1, $14
         37      > JMPNZ_EX                                         ~15     ~15, ->43
         38    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         39        DO_FCALL                                      0  $16     
         40        CONCAT                                           ~17     'Failed+to+connect+to+MySQL%3A+', $16
         41      > EXIT                                                     ~17
         42*       BOOL                                             ~15     <true>
   38    43    >   FETCH_IS                                         ~18     '_POST'
         44        ISSET_ISEMPTY_DIM_OBJ                         0          ~18, 'submit'
         45      > JMPZ                                                     ~19, ->48
   39    46    >   INIT_FCALL                                               'signup'
         47        DO_FCALL                                      0          
   43    48    > > RETURN                                                   1

Function newuser:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 37, Position 2 = 41
Branch analysis from position: 37
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 43
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/7TocM
function name:  NewUser
number of ops:  44
compiled vars:  !0 = $firstName, !1 = $lastName, !2 = $companyName, !3 = $phoneNumber, !4 = $email, !5 = $password, !6 = $query, !7 = $irstName, !8 = $email_address, !9 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_R                      global              ~10     '_POST'
          1        FETCH_DIM_R                                      ~11     ~10, 'first_name'
          2        ASSIGN                                                   !0, ~11
   13     3        FETCH_R                      global              ~13     '_POST'
          4        FETCH_DIM_R                                      ~14     ~13, 'last_name'
          5        ASSIGN                                                   !1, ~14
   14     6        FETCH_R                      global              ~16     '_POST'
          7        FETCH_DIM_R                                      ~17     ~16, 'company_name'
          8        ASSIGN                                                   !2, ~17
   15     9        FETCH_R                      global              ~19     '_POST'
         10        FETCH_DIM_R                                      ~20     ~19, 'phone_number'
         11        ASSIGN                                                   !3, ~20
   16    12        FETCH_R                      global              ~22     '_POST'
         13        FETCH_DIM_R                                      ~23     ~22, 'email_address'
         14        ASSIGN                                                   !4, ~23
   17    15        FETCH_R                      global              ~25     '_POST'
         16        FETCH_DIM_R                                      ~26     ~25, 'password'
         17        ASSIGN                                                   !5, ~26
   18    18        ROPE_INIT                                    13  ~29     'INSERT+INTO+WebsiteUsers+%28firstName%2ClastName%2CcompanyName%2CphoneNumber%2Cemail_address%2Cpassword%29+VALUES+%28%27'
         19        ROPE_ADD                                      1  ~29     ~29, !7
         20        ROPE_ADD                                      2  ~29     ~29, '%27%2C%27'
         21        ROPE_ADD                                      3  ~29     ~29, !1
         22        ROPE_ADD                                      4  ~29     ~29, '%27%27'
         23        ROPE_ADD                                      5  ~29     ~29, !2
         24        ROPE_ADD                                      6  ~29     ~29, '%27%2C%27'
         25        ROPE_ADD                                      7  ~29     ~29, !3
         26        ROPE_ADD                                      8  ~29     ~29, '%27%2C%27'
         27        ROPE_ADD                                      9  ~29     ~29, !8
         28        ROPE_ADD                                     10  ~29     ~29, '%27%2C%27'
         29        ROPE_ADD                                     11  ~29     ~29, !5
         30        ROPE_END                                     12  ~28     ~29, '%27%29'
         31        ASSIGN                                                   !6, ~28
   19    32        INIT_FCALL_BY_NAME                                       'mysql_query'
         33        SEND_VAR_EX                                              !6
         34        DO_FCALL                                      0  $37     
         35        ASSIGN                                           ~38     !9, $37
         36      > JMPNZ_EX                                         ~38     ~38, ->41
         37    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         38        DO_FCALL                                      0  $39     
         39      > EXIT                                                     $39
         40*       BOOL                                             ~38     <true>
   21    41    > > JMPZ                                                     !9, ->43
   22    42    >   ECHO                                                     'YOUR+REGISTRATION+IS+COMPLETED...'
   24    43    > > RETURN                                                   null

End of function newuser

Function signup:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 37
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 47) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 36
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/7TocM
function name:  SignUp
number of ops:  38
compiled vars:  !0 = $query, !1 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   FETCH_IS                                         ~2      '_POST'
          1        ISSET_ISEMPTY_DIM_OBJ                         1  ~3      ~2, 'user'
          2        BOOL_NOT                                         ~4      ~3
          3      > JMPZ                                                     ~4, ->37
   29     4    >   INIT_FCALL_BY_NAME                                       'mysql_query'
          5        ROPE_INIT                                     5  ~10     'SELECT+%2A+FROM+WebsiteUsers+WHERE+email_address+%3D+%27'
          6        FETCH_R                      global              ~5      '_POST'
          7        FETCH_DIM_R                                      ~6      ~5, 'email_address'
          8        ROPE_ADD                                      1  ~10     ~10, ~6
          9        ROPE_ADD                                      2  ~10     ~10, '%27+AND+password+%3D+%27'
         10        FETCH_R                      global              ~7      '_POST'
         11        FETCH_DIM_R                                      ~8      ~7, 'password'
         12        ROPE_ADD                                      3  ~10     ~10, ~8
         13        ROPE_END                                      4  ~9      ~10, '%27'
         14        SEND_VAL_EX                                              ~9
         15        DO_FCALL                                      0  $13     
         16        ASSIGN                                           ~14     !0, $13
         17      > JMPNZ_EX                                         ~14     ~14, ->22
         18    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         19        DO_FCALL                                      0  $15     
         20      > EXIT                                                     $15
         21*       BOOL                                             ~14     <true>
   31    22    >   INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         23        SEND_VAR_EX                                              !0
         24        DO_FCALL                                      0  $16     
         25        ASSIGN                                           ~17     !1, $16
         26        BOOL_NOT                                         ~18     ~17
         27      > JMPNZ_EX                                         ~18     ~18, ->32
         28    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         29        DO_FCALL                                      0  $19     
         30      > EXIT                                                     $19
         31*       BOOL                                             ~18     <true>
         32    > > JMPZ                                                     ~18, ->36
   32    33    >   INIT_FCALL                                               'newuser'
         34        DO_FCALL                                      0          
         35      > JMP                                                      ->37
   34    36    >   ECHO                                                     'SORRY...YOU+ARE+ALREADY+REGISTERED+USER...'
   37    37    > > RETURN                                                   null

End of function signup

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.02 ms | 1402 KiB | 17 Q