3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Ler dados enviados pelo formulario gerado if(isset($_POST["enviar"])){ foreach($_POST["checkbox"] as $key=>$value){ // echo "ID: " . $id . " Nome: " . $_POST["nome"][$id] . "<br/>"; echo $id_saida = mysql_real_escape_string($value); $tipo = mysql_real_escape_string($_POST['tipo_serv'][$key]); echo $nome = mysql_real_escape_string($_POST['nome'][$key]); $start = mysql_real_escape_string($_POST['start'][$key]); echo $valor = mysql_real_escape_string($_POST['valor'][$key]); $desconto = mysql_real_escape_string($_POST['desconto'][$key]); $tipo_veiculo = mysql_real_escape_string($_POST['tipo_veiculo'][$key]); } } // Conexao $mysqli = new mysqli("localhost", "root", "", "example"); ################### $id_transfer = ""; ################### $sql = "SELECT * FROM produtos where id_transfer = '$id_transfer' AND tipo_serv <> 'Regular'"; $form = null; if($query = mysqli_query($mysqli, $sql)){ $form .= "<table>"; while($linha = mysqli_fetch_object($query)){ // $form .= "({$linha->id}) <input type=\"checkbox\" name=\"checkbox[{$linha->id}]\" value=\"{$linha->id}\"/>{$linha->nome}<br/>"; // $form .= "<input type=\"hidden\" name=\"nome[{$linha->id}]\" value=\"{$linha->nome}\"/>"; ################################################################################################################################## $id_produtos = $linha['id_produtos']; $nome = $linha['nome']; $valor = $linha['valor']; $tipo_serv = $linha['tipo_serv']; $form .= "<td><input name=\"checkbox[{$id_produtos}]\" type=\"checkbox\" value=\"{$id_produtos}\"/></td>"; $form .= "<td>{$id_produtos}</td>"; $form .= "<td><input type=\"hidden\" name=\"nome[{$id_produtos}]\" value=\"{$nome}\" /></td>"; $form .= "<td><input type=\"hidden\" name=\"tipo_serv[{$id_produtos}]\" value=\"{$tipo_serv}\" /></td>"; $form .= "<td><input type=\"hidden\" name=\"valor[{$id_produtos}]\"value=\"{$valor}\" /></td>"; } $form .= "</table>"; // Montar o resto do formulário ?> <hr> <form method="POST" action=""> <!-- Resto !--> <?php echo $form; ?> <!-- Resto !--> <input type="submit" name="enviar" value="enviar"/> </form> <?php } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 65
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 64
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 64
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 84, Position 2 = 131
Branch analysis from position: 84
1 jumps found. (Code = 42) Position 1 = 122
Branch analysis from position: 122
2 jumps found. (Code = 44) Position 1 = 127, Position 2 = 86
Branch analysis from position: 127
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 86
2 jumps found. (Code = 44) Position 1 = 127, Position 2 = 86
Branch analysis from position: 127
Branch analysis from position: 86
Branch analysis from position: 131
Branch analysis from position: 64
Branch analysis from position: 65
filename:       /in/ErSeU
function name:  (null)
number of ops:  132
compiled vars:  !0 = $value, !1 = $key, !2 = $id_saida, !3 = $tipo, !4 = $nome, !5 = $start, !6 = $valor, !7 = $desconto, !8 = $tipo_veiculo, !9 = $mysqli, !10 = $id_transfer, !11 = $sql, !12 = $form, !13 = $query, !14 = $id_produtos, !15 = $linha, !16 = $tipo_serv
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   4     0  E >   FETCH_IS                                         ~17     '_POST'
         1        ISSET_ISEMPTY_DIM_OBJ                         0  ~18     ~17, 'enviar'
         2      > JMPZ                                                     ~18, ->65
   5     3    >   FETCH_R                      global              ~19     '_POST'
         4        FETCH_DIM_R                                      ~20     ~19, 'checkbox'
         5      > FE_RESET_R                                       $21     ~20, ->64
         6    > > FE_FETCH_R                                       ~22     $21, !0, ->64
         7    >   QM_ASSIGN                                                !1
   7     8        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         9        SEND_VAR_EX                                              !0
        10        DO_FCALL                                      0  $24     
        11        QM_ASSIGN                                        $25     !2
        12        ASSIGN_OBJ                                               $25
   8    13        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
        14        CHECK_FUNC_ARG                                           
        15        FETCH_FUNC_ARG               global              $26     '_POST'
        16        FETCH_DIM_FUNC_ARG                               $27     $26, 'tipo_serv'
        17        FETCH_DIM_FUNC_ARG                               $28     $27, !1
        18        SEND_FUNC_ARG                                            $28
        19        DO_FCALL                                      0  $29     
        20        QM_ASSIGN                                                !3
   9    21        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
        22        CHECK_FUNC_ARG                                           
        23        FETCH_FUNC_ARG               global              $31     '_POST'
        24        FETCH_DIM_FUNC_ARG                               $32     $31, 'nome'
        25        FETCH_DIM_FUNC_ARG                               $33     $32, !1
        26        SEND_FUNC_ARG                                            $33
        27        DO_FCALL                                      0  $34     
        28        QM_ASSIGN                                        $35     !4
        29        ASSIGN_OBJ                                               $35
  10    30        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
        31        CHECK_FUNC_ARG                                           
        32        FETCH_FUNC_ARG               global              $36     '_POST'
        33        FETCH_DIM_FUNC_ARG                               $37     $36, 'start'
        34        FETCH_DIM_FUNC_ARG                               $38     $37, !1
        35        SEND_FUNC_ARG                                            $38
        36        DO_FCALL                                      0  $39     
        37        QM_ASSIGN                                                !5
  11    38        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
        39        CHECK_FUNC_ARG                                           
        40        FETCH_FUNC_ARG               global              $41     '_POST'
        41        FETCH_DIM_FUNC_ARG                               $42     $41, 'valor'
        42        FETCH_DIM_FUNC_ARG                               $43     $42, !1
        43        SEND_FUNC_ARG                                            $43
        44        DO_FCALL                                      0  $44     
        45        QM_ASSIGN                                        $45     !6
        46        ASSIGN_OBJ                                               $45
  12    47        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
        48        CHECK_FUNC_ARG                                           
        49        FETCH_FUNC_ARG               global              $46     '_POST'
        50        FETCH_DIM_FUNC_ARG                               $47     $46, 'desconto'
        51        FETCH_DIM_FUNC_ARG                               $48     $47, !1
        52        SEND_FUNC_ARG                                            $48
        53        DO_FCALL                                      0  $49     
        54        QM_ASSIGN                                                !7
  13    55        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
        56        CHECK_FUNC_ARG                                           
        57        FETCH_FUNC_ARG               global              $51     '_POST'
        58        FETCH_DIM_FUNC_ARG                               $52     $51, 'tipo_veiculo'
        59        FETCH_DIM_FUNC_ARG                               $53     $52, !1
        60        SEND_FUNC_ARG                                            $53
        61        DO_FCALL                                      0  $54     
        62        QM_ASSIGN                                                !8
   5    63      > JMP                                                      ->6
        64    >   FE_FREE                                                  $21
  19    65    >   NEW                                              $56     :159
        66        SEND_VAL_EX                                              'localhost'
        67        SEND_VAL_EX                                              'root'
        68        SEND_VAL_EX                                              ''
        69        SEND_VAL_EX                                              'example'
        70        DO_FCALL                                      0          
        71        QM_ASSIGN                                                !9
  21    72        QM_ASSIGN                                                !10
  23    73        ROPE_INIT                                     3  ~61     'SELECT+%2A+FROM+produtos+where+id_transfer+%3D+%27'
        74        ROPE_ADD                                      1  ~61     ~61, !10
        75        ROPE_END                                      2  ~60     ~61, '%27+AND+++tipo_serv+%3C%3E+%27Regular%27'
        76        QM_ASSIGN                                                !11
  24    77        QM_ASSIGN                                                !12
  26    78        INIT_FCALL_BY_NAME                                       'mysqli_query'
        79        SEND_VAR_EX                                              !9
        80        SEND_VAR_EX                                              !11
        81        DO_FCALL                                      0  $65     
        82        QM_ASSIGN                                        $66     !13
        83      > JMPZ                                                     $66, ->131
  27    84    >   ASSIGN_DIV                                    8          !12, '%3Ctable%3E'
  28    85      > JMP                                                      ->122
  32    86    >   FETCH_DIM_R                                      ~68     !15, 'id_produtos'
        87        QM_ASSIGN                                                !14
  33    88        FETCH_DIM_R                                      ~70     !15, 'nome'
        89        QM_ASSIGN                                                !4
  34    90        FETCH_DIM_R                                      ~72     !15, 'valor'
        91        QM_ASSIGN                                                !6
  35    92        FETCH_DIM_R                                      ~74     !15, 'tipo_serv'
        93        QM_ASSIGN                                                !16
  36    94        ROPE_INIT                                     5  ~77     '%3Ctd%3E%3Cinput+name%3D%22checkbox%5B'
        95        ROPE_ADD                                      1  ~77     ~77, !14
        96        ROPE_ADD                                      2  ~77     ~77, '%5D%22+type%3D%22checkbox%22+value%3D%22'
        97        ROPE_ADD                                      3  ~77     ~77, !14
        98        ROPE_END                                      4  ~76     ~77, '%22%2F%3E%3C%2Ftd%3E'
        99        ASSIGN_DIV                                    8          !12, ~76
  37   100        ROPE_INIT                                     3  ~82     '%3Ctd%3E'
       101        ROPE_ADD                                      1  ~82     ~82, !14
       102        ROPE_END                                      2  ~81     ~82, '%3C%2Ftd%3E'
       103        ASSIGN_DIV                                    8          !12, ~81
  38   104        ROPE_INIT                                     5  ~86     '%3Ctd%3E%3Cinput+type%3D%22hidden%22+name%3D%22nome%5B'
       105        ROPE_ADD                                      1  ~86     ~86, !14
       106        ROPE_ADD                                      2  ~86     ~86, '%5D%22++value%3D%22'
       107        ROPE_ADD                                      3  ~86     ~86, !4
       108        ROPE_END                                      4  ~85     ~86, '%22+%2F%3E%3C%2Ftd%3E'
       109        ASSIGN_DIV                                    8          !12, ~85
  39   110        ROPE_INIT                                     5  ~91     '%3Ctd%3E%3Cinput+type%3D%22hidden%22+name%3D%22tipo_serv%5B'
       111        ROPE_ADD                                      1  ~91     ~91, !14
       112        ROPE_ADD                                      2  ~91     ~91, '%5D%22++value%3D%22'
       113        ROPE_ADD                                      3  ~91     ~91, !16
       114        ROPE_END                                      4  ~90     ~91, '%22+%2F%3E%3C%2Ftd%3E'
       115        ASSIGN_DIV                                    8          !12, ~90
  40   116        ROPE_INIT                                     5  ~96     '%3Ctd%3E%3Cinput+type%3D%22hidden%22+name%3D%22valor%5B'
       117        ROPE_ADD                                      1  ~96     ~96, !14
       118        ROPE_ADD                                      2  ~96     ~96, '%5D%22value%3D%22'
       119        ROPE_ADD                                      3  ~96     ~96, !6
       120        ROPE_END                                      4  ~95     ~96, '%22+%2F%3E%3C%2Ftd%3E'
       121        ASSIGN_DIV                                    8          !12, ~95
  28   122    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_object'
       123        SEND_VAR_EX                                              !13
       124        DO_FCALL                                      0  $100    
       125        QM_ASSIGN                                        $101    !15
       126      > JMPNZ                                                    $101, ->86
  42   127    >   ASSIGN_DIV                                    8          !12, '%3C%2Ftable%3E'
  47   128        ASSIGN_OBJ                                               '%09%3Chr%3E%0A%09%3Cform+method%3D%22POST%22+action%3D%22%22%3E%0A%09%3C%21--+Resto+%21--%3E%0A%09'
  50   129        ASSIGN_OBJ                                               !12
  51   130        ASSIGN_OBJ                                               '%09%3C%21--+Resto+%21--%3E%0A%09%3Cinput+type%3D%22submit%22+name%3D%22enviar%22+value%3D%22enviar%22%2F%3E%0A%09%3C%2Fform%3E%0A%09%0A%09'
  58   131    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
19.78 ms | 474 KiB | 7 Q