3v4l.org

run code in 300+ PHP versions simultaneously
<!------------------------------------------------GERAR COTAÇÂO-----------------------------------------------> <?php $form = $_GET['form']; if ($form == "cotacao"){ $id_transfer = $_POST['id_transfer']; $id_produto = $_POST['id_saida']; $id_empresa = $_POST['empresa']; $status = $_POST['status']; $solicitante = $_POST['user_soli']; date_default_timezone_set('America/Sao_Paulo'); $data1 = date('Y'); $data = date('Y-m-d'); $hora1 = date('His'); $data_abertura = substr($data1, 0, 4); //////////////Auto Numeração////////////////////////////////////////////////////////// $qr = mysql_query("SELECT max(cod) as cod FROM cotacao where id_transfer='$id_transfer'"); // pega o ultimo id e soma mais 1 $z = mysql_fetch_object($qr); $cod1 = $z->cod; if($cod1 == 0){ $cod = 1; }else{ $cod = $cod1 + 1; } ////////////////////////////////////////////////////////// //$cod = $id_transfer.$id_produto.$data_abertura.$hora1; if (isset($_POST['checkbox'])) { foreach ($_POST['checkbox'] as $key => $value) { echo $id_saida = mysql_real_escape_string($value); //$id_saida = mysql_real_escape_string($_POST['id_saida'][$key]); $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]); $query = mysql_query ("INSERT INTO cotacao (id_transfer,id_produto,id_empresa,id_saida,status,data_de_saida,cod,solicitante,data_abertura,tipo,nome,valor,desconto,tipo_veiculo)VALUES ('$id_transfer','{$id_saida}','$id_empresa','{$id_saida}','$status','$start','$cod','$solicitante','$data','{$tipo}','{$nome}','{$valor}','{$desconto}','{$tipo_veiculo}')", $conexao) or die( mysql_error()); }} //echo "<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=cotacao.php?cod=$cod'>"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 165
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 59
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 165
Branch analysis from position: 64
2 jumps found. (Code = 77) Position 1 = 67, Position 2 = 164
Branch analysis from position: 67
2 jumps found. (Code = 78) Position 1 = 68, Position 2 = 164
Branch analysis from position: 68
2 jumps found. (Code = 47) Position 1 = 159, Position 2 = 163
Branch analysis from position: 159
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 163
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
Branch analysis from position: 164
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 164
Branch analysis from position: 165
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 165
Branch analysis from position: 64
Branch analysis from position: 165
Branch analysis from position: 165
filename:       /in/L2SoW
function name:  (null)
number of ops:  166
compiled vars:  !0 = $form, !1 = $id_transfer, !2 = $id_produto, !3 = $id_empresa, !4 = $status, !5 = $solicitante, !6 = $data1, !7 = $data, !8 = $hora1, !9 = $data_abertura, !10 = $qr, !11 = $z, !12 = $cod1, !13 = $cod, !14 = $value, !15 = $key, !16 = $id_saida, !17 = $tipo, !18 = $nome, !19 = $start, !20 = $valor, !21 = $desconto, !22 = $tipo_veiculo, !23 = $query, !24 = $conexao
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3C%21------------------------------------------------GERAR+COTA%C3%87%C3%82O-----------------------------------------------%3E%0A%0A'
    5     1        FETCH_R                      global              ~25     '_GET'
          2        FETCH_DIM_R                                      ~26     ~25, 'form'
          3        ASSIGN                                                   !0, ~26
    6     4        IS_EQUAL                                                 !0, 'cotacao'
          5      > JMPZ                                                     ~28, ->165
    8     6    >   FETCH_R                      global              ~29     '_POST'
          7        FETCH_DIM_R                                      ~30     ~29, 'id_transfer'
          8        ASSIGN                                                   !1, ~30
    9     9        FETCH_R                      global              ~32     '_POST'
         10        FETCH_DIM_R                                      ~33     ~32, 'id_saida'
         11        ASSIGN                                                   !2, ~33
   10    12        FETCH_R                      global              ~35     '_POST'
         13        FETCH_DIM_R                                      ~36     ~35, 'empresa'
         14        ASSIGN                                                   !3, ~36
   11    15        FETCH_R                      global              ~38     '_POST'
         16        FETCH_DIM_R                                      ~39     ~38, 'status'
         17        ASSIGN                                                   !4, ~39
   12    18        FETCH_R                      global              ~41     '_POST'
         19        FETCH_DIM_R                                      ~42     ~41, 'user_soli'
         20        ASSIGN                                                   !5, ~42
   16    21        INIT_FCALL                                               'date_default_timezone_set'
         22        SEND_VAL                                                 'America%2FSao_Paulo'
         23        DO_ICALL                                                 
   17    24        INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'Y'
         26        DO_ICALL                                         $45     
         27        ASSIGN                                                   !6, $45
   18    28        INIT_FCALL                                               'date'
         29        SEND_VAL                                                 'Y-m-d'
         30        DO_ICALL                                         $47     
         31        ASSIGN                                                   !7, $47
   19    32        INIT_FCALL                                               'date'
         33        SEND_VAL                                                 'His'
         34        DO_ICALL                                         $49     
         35        ASSIGN                                                   !8, $49
   21    36        INIT_FCALL                                               'substr'
         37        SEND_VAR                                                 !6
         38        SEND_VAL                                                 0
         39        SEND_VAL                                                 4
         40        DO_ICALL                                         $51     
         41        ASSIGN                                                   !9, $51
   24    42        INIT_FCALL_BY_NAME                                       'mysql_query'
         43        ROPE_INIT                                     3  ~54     'SELECT+max%28cod%29+as+cod+FROM+cotacao+where+id_transfer%3D%27'
         44        ROPE_ADD                                      1  ~54     ~54, !1
         45        ROPE_END                                      2  ~53     ~54, '%27'
         46        SEND_VAL_EX                                              ~53
         47        DO_FCALL                                      0  $56     
         48        ASSIGN                                                   !10, $56
   25    49        INIT_FCALL_BY_NAME                                       'mysql_fetch_object'
         50        SEND_VAR_EX                                              !10
         51        DO_FCALL                                      0  $58     
         52        ASSIGN                                                   !11, $58
   26    53        FETCH_OBJ_R                                      ~60     !11, 'cod'
         54        ASSIGN                                                   !12, ~60
   27    55        IS_EQUAL                                                 !12, 0
         56      > JMPZ                                                     ~62, ->59
   28    57    >   ASSIGN                                                   !13, 1
         58      > JMP                                                      ->61
   30    59    >   ADD                                              ~64     !12, 1
         60        ASSIGN                                                   !13, ~64
   37    61    >   FETCH_IS                                         ~66     '_POST'
         62        ISSET_ISEMPTY_DIM_OBJ                         0          ~66, 'checkbox'
         63      > JMPZ                                                     ~67, ->165
   38    64    >   FETCH_R                      global              ~68     '_POST'
         65        FETCH_DIM_R                                      ~69     ~68, 'checkbox'
         66      > FE_RESET_R                                       $70     ~69, ->164
         67    > > FE_FETCH_R                                       ~71     $70, !14, ->164
         68    >   ASSIGN                                                   !15, ~71
   39    69        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         70        SEND_VAR_EX                                              !14
         71        DO_FCALL                                      0  $73     
         72        ASSIGN                                           ~74     !16, $73
         73        ECHO                                                     ~74
   41    74        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         75        CHECK_FUNC_ARG                                           
         76        FETCH_FUNC_ARG               global              $75     '_POST'
         77        FETCH_DIM_FUNC_ARG                               $76     $75, 'tipo_serv'
         78        FETCH_DIM_FUNC_ARG                               $77     $76, !15
         79        SEND_FUNC_ARG                                            $77
         80        DO_FCALL                                      0  $78     
         81        ASSIGN                                                   !17, $78
   42    82        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         83        CHECK_FUNC_ARG                                           
         84        FETCH_FUNC_ARG               global              $80     '_POST'
         85        FETCH_DIM_FUNC_ARG                               $81     $80, 'nome'
         86        FETCH_DIM_FUNC_ARG                               $82     $81, !15
         87        SEND_FUNC_ARG                                            $82
         88        DO_FCALL                                      0  $83     
         89        ASSIGN                                           ~84     !18, $83
         90        ECHO                                                     ~84
   43    91        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         92        CHECK_FUNC_ARG                                           
         93        FETCH_FUNC_ARG               global              $85     '_POST'
         94        FETCH_DIM_FUNC_ARG                               $86     $85, 'start'
         95        FETCH_DIM_FUNC_ARG                               $87     $86, !15
         96        SEND_FUNC_ARG                                            $87
         97        DO_FCALL                                      0  $88     
         98        ASSIGN                                                   !19, $88
   44    99        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
        100        CHECK_FUNC_ARG                                           
        101        FETCH_FUNC_ARG               global              $90     '_POST'
        102        FETCH_DIM_FUNC_ARG                               $91     $90, 'valor'
        103        FETCH_DIM_FUNC_ARG                               $92     $91, !15
        104        SEND_FUNC_ARG                                            $92
        105        DO_FCALL                                      0  $93     
        106        ASSIGN                                           ~94     !20, $93
        107        ECHO                                                     ~94
   45   108        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
        109        CHECK_FUNC_ARG                                           
        110        FETCH_FUNC_ARG               global              $95     '_POST'
        111        FETCH_DIM_FUNC_ARG                               $96     $95, 'desconto'
        112        FETCH_DIM_FUNC_ARG                               $97     $96, !15
        113        SEND_FUNC_ARG                                            $97
        114        DO_FCALL                                      0  $98     
        115        ASSIGN                                                   !21, $98
   46   116        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
        117        CHECK_FUNC_ARG                                           
        118        FETCH_FUNC_ARG               global              $100    '_POST'
        119        FETCH_DIM_FUNC_ARG                               $101    $100, 'tipo_veiculo'
        120        FETCH_DIM_FUNC_ARG                               $102    $101, !15
        121        SEND_FUNC_ARG                                            $102
        122        DO_FCALL                                      0  $103    
        123        ASSIGN                                                   !22, $103
   48   124        INIT_FCALL_BY_NAME                                       'mysql_query'
        125        ROPE_INIT                                    29  ~106    'INSERT+INTO+cotacao%0A%28id_transfer%2Cid_produto%2Cid_empresa%2Cid_saida%2Cstatus%2Cdata_de_saida%2Ccod%2Csolicitante%2Cdata_abertura%2Ctipo%2Cnome%2Cvalor%2Cdesconto%2Ctipo_veiculo%29VALUES%0A%28%27'
   50   126        ROPE_ADD                                      1  ~106    ~106, !1
        127        ROPE_ADD                                      2  ~106    ~106, '%27%2C%27'
        128        ROPE_ADD                                      3  ~106    ~106, !16
        129        ROPE_ADD                                      4  ~106    ~106, '%27%2C%27'
        130        ROPE_ADD                                      5  ~106    ~106, !3
        131        ROPE_ADD                                      6  ~106    ~106, '%27%2C%27'
        132        ROPE_ADD                                      7  ~106    ~106, !16
        133        ROPE_ADD                                      8  ~106    ~106, '%27%2C%27'
        134        ROPE_ADD                                      9  ~106    ~106, !4
        135        ROPE_ADD                                     10  ~106    ~106, '%27%2C%27'
        136        ROPE_ADD                                     11  ~106    ~106, !19
        137        ROPE_ADD                                     12  ~106    ~106, '%27%2C%27'
        138        ROPE_ADD                                     13  ~106    ~106, !13
        139        ROPE_ADD                                     14  ~106    ~106, '%27%2C%27'
        140        ROPE_ADD                                     15  ~106    ~106, !5
        141        ROPE_ADD                                     16  ~106    ~106, '%27%2C%27'
        142        ROPE_ADD                                     17  ~106    ~106, !7
        143        ROPE_ADD                                     18  ~106    ~106, '%27%2C%27'
        144        ROPE_ADD                                     19  ~106    ~106, !17
        145        ROPE_ADD                                     20  ~106    ~106, '%27%2C%27'
        146        ROPE_ADD                                     21  ~106    ~106, !18
        147        ROPE_ADD                                     22  ~106    ~106, '%27%2C%27'
        148        ROPE_ADD                                     23  ~106    ~106, !20
        149        ROPE_ADD                                     24  ~106    ~106, '%27%2C%27'
        150        ROPE_ADD                                     25  ~106    ~106, !21
        151        ROPE_ADD                                     26  ~106    ~106, '%27%2C%27'
        152        ROPE_ADD                                     27  ~106    ~106, !22
        153        ROPE_END                                     28  ~105    ~106, '%27%29'
        154        SEND_VAL_EX                                              ~105
   48   155        SEND_VAR_EX                                              !24
        156        DO_FCALL                                      0  $121    
        157        ASSIGN                                           ~122    !23, $121
        158      > JMPNZ_EX                                         ~122    ~122, ->163
   50   159    >   INIT_FCALL_BY_NAME                                       'mysql_error'
        160        DO_FCALL                                      0  $123    
        161      > EXIT                                                     $123
        162*       BOOL                                             ~122    <true>
   38   163    > > JMP                                                      ->67
        164    >   FE_FREE                                                  $70
   58   165    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.04 ms | 1404 KiB | 19 Q