3v4l.org

run code in 300+ PHP versions simultaneously
<?php // TEST CODE //echo "<input type=submit name=submitbtn3>"; //echo "<input type=submit name=submit900>"; //echo "<input type=submit name=submitbtn123>"; //echo "<input type=submit name=submitbtn33>"; //echo "<input type=submit name=submitbtn44>"; //echo "<input type=submit name=submitbtn55>"; // END TEST CODE if ($_POST['submitbtn3']) { // CAME FROM SELECT PATIENTPAGE $_SESSION['PATIENTID'] = $_POST['myselect3']; // GET CLIENT NAME $con=mysqli_connect("50.62.209.12:3306","Paul1","Welcome4$","Theravet"); $result = mysqli_query($con,"SELECT * FROM Clients WHERE ID='". $_SESSION['MYCLIENTSELECTED'] ."'"); while( $row = mysqli_fetch_array($result)) { $_SESSION['MYCLIENTNAMETEMP']= trim($row['First']); } mysqli_close($con); // ********************************************************************************* // TEMP FOR TESTING UNCOMMENT THIS PARAGRAPH AFTER TESTING IS COMPLETED 12-03-2015 // ********************************************************************************** //$con=mysqli_connect("50.62.209.12:3306","Paul1","Welcome4$","Theravet"); //if (mysqli_connect_errno()) // { // echo "Failed to connect to MySQL: " . mysqli_connect_error(); //} //$sql="UPDATE Patients SET ClientFirstName='". $_SESSION['MYCLIENTNAMETEMP']."' WHERE ID='" .$_SESSION['PATIENTID']. "'"; //if (!mysqli_query($con,$sql)) // { // die('Error: ' . mysqli_error($con)); // } // mysqli_close($con); PrevFormPosted(); } elseif($_POST['submit900']) { $allowedExts = array("gif", "jpeg", "jpg", "png","JPEG","JPG","GIF"); $temp = explode(".", $_FILES["file"]["name"]); $extension = end($temp); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/x-png") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/JPG") || ($_FILES["file"]["type"] == "image/JPEG") || ($_FILES["file"]["type"] == "image/GIF")) && ($_FILES["file"]["size"] < 500000) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { //echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { if (file_exists("upload/" . $_FILES["file"]["name"])) { //echo $_FILES["file"]["name"] . " already exists. "; } else { $temp = explode(".",$_FILES["file"]["name"]); $file_name = date('d-m-y-H-i-s',time()) . '.' .end($temp); //$file_name = date('d-m-y-H-i-s',time()) . $_FILES["file"]["name"]; move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $file_name); // UPDATE WITH NEW DATA $con=mysqli_connect("50.62.209.12:3306","Paul1","Welcome4$","Theravet"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } mysqli_query($con,"UPDATE Patients SET ImgName='".$file_name."' WHERE ID='".$_SESSION['PATIENTID']."'"); mysqli_close($con); //echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } } } else { //echo "Invalid File"; } PrevFormPosted(); } elseif($_POST['submitbtn123']){ // comes back from patient upload image PrevFormPosted(); } elseif($_POST['submitbtn33']) { //exit added this line 1/12/2015 ThisFormPosted(); ?> <?php //<meta http-equiv="refresh" content="1;url=Menu.php"> ?> <?php } elseif($_POST['submitbtn44']) { MyCancel(); } elseif($_POST['submitbtn55']) { } else { ThisFormPosted(); } ?> <?php //function ThisFormPosted(){ // echo "This form posted function"; //} ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 43
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 25
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 224
Branch analysis from position: 224
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 25
Branch analysis from position: 37
Branch analysis from position: 25
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 198
Branch analysis from position: 46
2 jumps found. (Code = 47) Position 1 = 64, Position 2 = 69
Branch analysis from position: 64
2 jumps found. (Code = 47) Position 1 = 70, Position 2 = 75
Branch analysis from position: 70
2 jumps found. (Code = 47) Position 1 = 76, Position 2 = 81
Branch analysis from position: 76
2 jumps found. (Code = 47) Position 1 = 82, Position 2 = 87
Branch analysis from position: 82
2 jumps found. (Code = 47) Position 1 = 88, Position 2 = 93
Branch analysis from position: 88
2 jumps found. (Code = 47) Position 1 = 94, Position 2 = 99
Branch analysis from position: 94
2 jumps found. (Code = 47) Position 1 = 100, Position 2 = 105
Branch analysis from position: 100
2 jumps found. (Code = 47) Position 1 = 106, Position 2 = 111
Branch analysis from position: 106
2 jumps found. (Code = 46) Position 1 = 112, Position 2 = 117
Branch analysis from position: 112
2 jumps found. (Code = 46) Position 1 = 118, Position 2 = 123
Branch analysis from position: 118
2 jumps found. (Code = 43) Position 1 = 124, Position 2 = 195
Branch analysis from position: 124
2 jumps found. (Code = 43) Position 1 = 129, Position 2 = 130
Branch analysis from position: 129
1 jumps found. (Code = 42) Position 1 = 194
Branch analysis from position: 194
1 jumps found. (Code = 42) Position 1 = 195
Branch analysis from position: 195
1 jumps found. (Code = 42) Position 1 = 224
Branch analysis from position: 224
Branch analysis from position: 130
2 jumps found. (Code = 43) Position 1 = 138, Position 2 = 139
Branch analysis from position: 138
1 jumps found. (Code = 42) Position 1 = 194
Branch analysis from position: 194
Branch analysis from position: 139
2 jumps found. (Code = 43) Position 1 = 177, Position 2 = 181
Branch analysis from position: 177
1 jumps found. (Code = 42) Position 1 = 195
Branch analysis from position: 195
Branch analysis from position: 181
Branch analysis from position: 195
Branch analysis from position: 123
Branch analysis from position: 117
Branch analysis from position: 111
Branch analysis from position: 105
Branch analysis from position: 99
Branch analysis from position: 93
Branch analysis from position: 87
Branch analysis from position: 81
Branch analysis from position: 75
Branch analysis from position: 69
Branch analysis from position: 198
2 jumps found. (Code = 43) Position 1 = 201, Position 2 = 204
Branch analysis from position: 201
1 jumps found. (Code = 42) Position 1 = 224
Branch analysis from position: 224
Branch analysis from position: 204
2 jumps found. (Code = 43) Position 1 = 207, Position 2 = 212
Branch analysis from position: 207
1 jumps found. (Code = 42) Position 1 = 224
Branch analysis from position: 224
Branch analysis from position: 212
2 jumps found. (Code = 43) Position 1 = 215, Position 2 = 218
Branch analysis from position: 215
1 jumps found. (Code = 42) Position 1 = 224
Branch analysis from position: 224
Branch analysis from position: 218
2 jumps found. (Code = 43) Position 1 = 221, Position 2 = 222
Branch analysis from position: 221
1 jumps found. (Code = 42) Position 1 = 224
Branch analysis from position: 224
Branch analysis from position: 222
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FUqmc
function name:  (null)
number of ops:  226
compiled vars:  !0 = $con, !1 = $result, !2 = $row, !3 = $allowedExts, !4 = $temp, !5 = $extension, !6 = $file_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_R                      global              ~7      '_POST'
          1        FETCH_DIM_R                                      ~8      ~7, 'submitbtn3'
          2      > JMPZ                                                     ~8, ->43
   21     3    >   FETCH_R                      global              ~11     '_POST'
          4        FETCH_DIM_R                                      ~12     ~11, 'myselect3'
          5        FETCH_W                      global              $9      '_SESSION'
          6        ASSIGN_DIM                                               $9, 'PATIENTID'
          7        OP_DATA                                                  ~12
   23     8        INIT_FCALL_BY_NAME                                       'mysqli_connect'
          9        SEND_VAL_EX                                              '50.62.209.12%3A3306'
         10        SEND_VAL_EX                                              'Paul1'
         11        SEND_VAL_EX                                              'Welcome4%24'
         12        SEND_VAL_EX                                              'Theravet'
         13        DO_FCALL                                      0  $13     
         14        ASSIGN                                                   !0, $13
   24    15        INIT_FCALL_BY_NAME                                       'mysqli_query'
         16        SEND_VAR_EX                                              !0
         17        FETCH_R                      global              ~15     '_SESSION'
         18        FETCH_DIM_R                                      ~16     ~15, 'MYCLIENTSELECTED'
         19        CONCAT                                           ~17     'SELECT+%2A+FROM+Clients+WHERE+ID%3D%27', ~16
         20        CONCAT                                           ~18     ~17, '%27'
         21        SEND_VAL_EX                                              ~18
         22        DO_FCALL                                      0  $19     
         23        ASSIGN                                                   !1, $19
   25    24      > JMP                                                      ->32
   27    25    >   INIT_FCALL                                               'trim'
         26        FETCH_DIM_R                                      ~23     !2, 'First'
         27        SEND_VAL                                                 ~23
         28        DO_ICALL                                         $24     
         29        FETCH_W                      global              $21     '_SESSION'
         30        ASSIGN_DIM                                               $21, 'MYCLIENTNAMETEMP'
         31        OP_DATA                                                  $24
   25    32    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_array'
         33        SEND_VAR_EX                                              !1
         34        DO_FCALL                                      0  $25     
         35        ASSIGN                                           ~26     !2, $25
         36      > JMPNZ                                                    ~26, ->25
   29    37    >   INIT_FCALL_BY_NAME                                       'mysqli_close'
         38        SEND_VAR_EX                                              !0
         39        DO_FCALL                                      0          
   52    40        INIT_FCALL_BY_NAME                                       'PrevFormPosted'
         41        DO_FCALL                                      0          
         42      > JMP                                                      ->224
   54    43    >   FETCH_R                      global              ~29     '_POST'
         44        FETCH_DIM_R                                      ~30     ~29, 'submit900'
         45      > JMPZ                                                     ~30, ->198
   55    46    >   ASSIGN                                                   !3, <array>
   56    47        INIT_FCALL                                               'explode'
         48        SEND_VAL                                                 '.'
         49        FETCH_R                      global              ~32     '_FILES'
         50        FETCH_DIM_R                                      ~33     ~32, 'file'
         51        FETCH_DIM_R                                      ~34     ~33, 'name'
         52        SEND_VAL                                                 ~34
         53        DO_ICALL                                         $35     
         54        ASSIGN                                                   !4, $35
   57    55        INIT_FCALL                                               'end'
         56        SEND_REF                                                 !4
         57        DO_ICALL                                         $37     
         58        ASSIGN                                                   !5, $37
   58    59        FETCH_R                      global              ~39     '_FILES'
         60        FETCH_DIM_R                                      ~40     ~39, 'file'
         61        FETCH_DIM_R                                      ~41     ~40, 'type'
         62        IS_EQUAL                                         ~42     ~41, 'image%2Fgif'
         63      > JMPNZ_EX                                         ~42     ~42, ->69
   59    64    >   FETCH_R                      global              ~43     '_FILES'
         65        FETCH_DIM_R                                      ~44     ~43, 'file'
         66        FETCH_DIM_R                                      ~45     ~44, 'type'
         67        IS_EQUAL                                         ~46     ~45, 'image%2Fjpeg'
         68        BOOL                                             ~42     ~46
         69    > > JMPNZ_EX                                         ~42     ~42, ->75
   60    70    >   FETCH_R                      global              ~47     '_FILES'
         71        FETCH_DIM_R                                      ~48     ~47, 'file'
         72        FETCH_DIM_R                                      ~49     ~48, 'type'
         73        IS_EQUAL                                         ~50     ~49, 'image%2Fjpg'
         74        BOOL                                             ~42     ~50
         75    > > JMPNZ_EX                                         ~42     ~42, ->81
   61    76    >   FETCH_R                      global              ~51     '_FILES'
         77        FETCH_DIM_R                                      ~52     ~51, 'file'
         78        FETCH_DIM_R                                      ~53     ~52, 'type'
         79        IS_EQUAL                                         ~54     ~53, 'image%2Fpjpeg'
         80        BOOL                                             ~42     ~54
         81    > > JMPNZ_EX                                         ~42     ~42, ->87
   62    82    >   FETCH_R                      global              ~55     '_FILES'
         83        FETCH_DIM_R                                      ~56     ~55, 'file'
         84        FETCH_DIM_R                                      ~57     ~56, 'type'
         85        IS_EQUAL                                         ~58     ~57, 'image%2Fx-png'
         86        BOOL                                             ~42     ~58
         87    > > JMPNZ_EX                                         ~42     ~42, ->93
   63    88    >   FETCH_R                      global              ~59     '_FILES'
         89        FETCH_DIM_R                                      ~60     ~59, 'file'
         90        FETCH_DIM_R                                      ~61     ~60, 'type'
         91        IS_EQUAL                                         ~62     ~61, 'image%2Fpng'
         92        BOOL                                             ~42     ~62
         93    > > JMPNZ_EX                                         ~42     ~42, ->99
   64    94    >   FETCH_R                      global              ~63     '_FILES'
         95        FETCH_DIM_R                                      ~64     ~63, 'file'
         96        FETCH_DIM_R                                      ~65     ~64, 'type'
         97        IS_EQUAL                                         ~66     ~65, 'image%2FJPG'
         98        BOOL                                             ~42     ~66
         99    > > JMPNZ_EX                                         ~42     ~42, ->105
   65   100    >   FETCH_R                      global              ~67     '_FILES'
        101        FETCH_DIM_R                                      ~68     ~67, 'file'
        102        FETCH_DIM_R                                      ~69     ~68, 'type'
        103        IS_EQUAL                                         ~70     ~69, 'image%2FJPEG'
        104        BOOL                                             ~42     ~70
        105    > > JMPNZ_EX                                         ~42     ~42, ->111
   66   106    >   FETCH_R                      global              ~71     '_FILES'
        107        FETCH_DIM_R                                      ~72     ~71, 'file'
        108        FETCH_DIM_R                                      ~73     ~72, 'type'
        109        IS_EQUAL                                         ~74     ~73, 'image%2FGIF'
        110        BOOL                                             ~42     ~74
        111    > > JMPZ_EX                                          ~42     ~42, ->117
   67   112    >   FETCH_R                      global              ~75     '_FILES'
        113        FETCH_DIM_R                                      ~76     ~75, 'file'
        114        FETCH_DIM_R                                      ~77     ~76, 'size'
        115        IS_SMALLER                                       ~78     ~77, 500000
        116        BOOL                                             ~42     ~78
        117    > > JMPZ_EX                                          ~42     ~42, ->123
   68   118    >   INIT_FCALL                                               'in_array'
        119        SEND_VAR                                                 !5
        120        SEND_VAR                                                 !3
        121        DO_ICALL                                         $79     
        122        BOOL                                             ~42     $79
        123    > > JMPZ                                                     ~42, ->195
   69   124    >   FETCH_R                      global              ~80     '_FILES'
        125        FETCH_DIM_R                                      ~81     ~80, 'file'
        126        FETCH_DIM_R                                      ~82     ~81, 'error'
        127        IS_SMALLER                                               0, ~82
        128      > JMPZ                                                     ~83, ->130
   70   129    > > JMP                                                      ->194
   75   130    >   INIT_FCALL                                               'file_exists'
        131        FETCH_R                      global              ~84     '_FILES'
        132        FETCH_DIM_R                                      ~85     ~84, 'file'
        133        FETCH_DIM_R                                      ~86     ~85, 'name'
        134        CONCAT                                           ~87     'upload%2F', ~86
        135        SEND_VAL                                                 ~87
        136        DO_ICALL                                         $88     
        137      > JMPZ                                                     $88, ->139
   76   138    > > JMP                                                      ->194
   81   139    >   INIT_FCALL                                               'explode'
        140        SEND_VAL                                                 '.'
        141        FETCH_R                      global              ~89     '_FILES'
        142        FETCH_DIM_R                                      ~90     ~89, 'file'
        143        FETCH_DIM_R                                      ~91     ~90, 'name'
        144        SEND_VAL                                                 ~91
        145        DO_ICALL                                         $92     
        146        ASSIGN                                                   !4, $92
   82   147        INIT_FCALL                                               'date'
        148        SEND_VAL                                                 'd-m-y-H-i-s'
        149        INIT_FCALL                                               'time'
        150        DO_ICALL                                         $94     
        151        SEND_VAR                                                 $94
        152        DO_ICALL                                         $95     
        153        CONCAT                                           ~96     $95, '.'
        154        INIT_FCALL                                               'end'
        155        SEND_REF                                                 !4
        156        DO_ICALL                                         $97     
        157        CONCAT                                           ~98     ~96, $97
        158        ASSIGN                                                   !6, ~98
   84   159        INIT_FCALL                                               'move_uploaded_file'
        160        FETCH_R                      global              ~100    '_FILES'
        161        FETCH_DIM_R                                      ~101    ~100, 'file'
        162        FETCH_DIM_R                                      ~102    ~101, 'tmp_name'
        163        SEND_VAL                                                 ~102
        164        CONCAT                                           ~103    'upload%2F', !6
        165        SEND_VAL                                                 ~103
        166        DO_ICALL                                                 
   86   167        INIT_FCALL_BY_NAME                                       'mysqli_connect'
        168        SEND_VAL_EX                                              '50.62.209.12%3A3306'
        169        SEND_VAL_EX                                              'Paul1'
        170        SEND_VAL_EX                                              'Welcome4%24'
        171        SEND_VAL_EX                                              'Theravet'
        172        DO_FCALL                                      0  $105    
        173        ASSIGN                                                   !0, $105
   87   174        INIT_FCALL_BY_NAME                                       'mysqli_connect_errno'
        175        DO_FCALL                                      0  $107    
        176      > JMPZ                                                     $107, ->181
   89   177    >   INIT_FCALL_BY_NAME                                       'mysqli_connect_error'
        178        DO_FCALL                                      0  $108    
        179        CONCAT                                           ~109    'Failed+to+connect+to+MySQL%3A+', $108
        180        ECHO                                                     ~109
   91   181    >   INIT_FCALL_BY_NAME                                       'mysqli_query'
        182        SEND_VAR_EX                                              !0
        183        CONCAT                                           ~110    'UPDATE+Patients+SET+ImgName%3D%27', !6
        184        CONCAT                                           ~111    ~110, '%27+WHERE+ID%3D%27'
        185        FETCH_R                      global              ~112    '_SESSION'
        186        FETCH_DIM_R                                      ~113    ~112, 'PATIENTID'
        187        CONCAT                                           ~114    ~111, ~113
        188        CONCAT                                           ~115    ~114, '%27'
        189        SEND_VAL_EX                                              ~115
        190        DO_FCALL                                      0          
   92   191        INIT_FCALL_BY_NAME                                       'mysqli_close'
        192        SEND_VAR_EX                                              !0
        193        DO_FCALL                                      0          
        194    > > JMP                                                      ->195
  101   195    >   INIT_FCALL_BY_NAME                                       'PrevFormPosted'
        196        DO_FCALL                                      0          
        197      > JMP                                                      ->224
  104   198    >   FETCH_R                      global              ~119    '_POST'
        199        FETCH_DIM_R                                      ~120    ~119, 'submitbtn123'
        200      > JMPZ                                                     ~120, ->204
  106   201    >   INIT_FCALL_BY_NAME                                       'PrevFormPosted'
        202        DO_FCALL                                      0          
        203      > JMP                                                      ->224
  108   204    >   FETCH_R                      global              ~122    '_POST'
        205        FETCH_DIM_R                                      ~123    ~122, 'submitbtn33'
        206      > JMPZ                                                     ~123, ->212
  110   207    >   INIT_FCALL_BY_NAME                                       'ThisFormPosted'
        208        DO_FCALL                                      0          
  112   209        ECHO                                                     '%0A++++++'
  116   210        ECHO                                                     '%0A'
        211      > JMP                                                      ->224
  119   212    >   FETCH_R                      global              ~125    '_POST'
        213        FETCH_DIM_R                                      ~126    ~125, 'submitbtn44'
        214      > JMPZ                                                     ~126, ->218
  120   215    >   INIT_FCALL_BY_NAME                                       'MyCancel'
        216        DO_FCALL                                      0          
        217      > JMP                                                      ->224
  122   218    >   FETCH_R                      global              ~128    '_POST'
        219        FETCH_DIM_R                                      ~129    ~128, 'submitbtn55'
        220      > JMPZ                                                     ~129, ->222
        221    > > JMP                                                      ->224
  125   222    >   INIT_FCALL_BY_NAME                                       'ThisFormPosted'
        223        DO_FCALL                                      0          
  128   224    >   ECHO                                                     '%0A%0A%0A%0A%0A'
  137   225      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.83 ms | 1420 KiB | 29 Q