3v4l.org

run code in 300+ PHP versions simultaneously
<html> <head> <title> Enviando E-mail... </title> <meta charset="UTF-8"> </head> <body> <?php // primeiro de tudo, faça uma validação nos campos para não enviar o email em branco // vou fazer só uma aqui, como exemplo // se não existir o campo email, "mata" todo o código if (!isset($_POST['email'])) { die(); } $emaildestino = $_POST['subcategoria']; $nome = $_POST['nome']; $sobrenome = $_POST['sobrenome']; $email = $_POST['email']; $telefone = $_POST['telefone']; $descricao = $_POST['mensagem']; $arquivo = $_FILES["arquivo"]; $boundary = "XYZ-".date("dmYis")."-ZYX"; $fp = fopen($arquivo["tmp_name"], "rb"); $anexo = fread($fp, filesize($arquivo["tmp_name"])); $anexo = base64_encode($anexo); fclose($fp); // cabeçalho do email $headers = "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/mixed; "; $headers .= "boundary=\"$boundary\"\r\n"; $headers .= "From: $email\n"; $headers .= "$boundary\n"; // email $data = "--$boundary\n"; $data .= "Content-Type: text/html; charset='utf-8'\n"; $data .= "<strong>Nome: </strong> $nome \r\n"; $data .= "<strong>Sobrenome: </strong> $sobrenome \r\n"; $data .= "<strong>E-mail: </strong> $email \r\n"; $data .= "<strong>Telefone: </strong> $telefone \r\n"; $data .= "<strong>Menssagem: </strong> $descricao \r\n"; $data .= "--$boundary \n"; // anexo $data .= "Content-Type: ".$arquivo["type"]."; name=".$arquivo['name']."\n"; $data .= "Content-Transfer-Encoding: base64 \n"; $data .= "Content-Disposition: attachment; filename=".$arquivo['name']."\r\n"; $data .= "$anexo \n"; $data .= "--$boundary \n"; $send = mail($emaildestino, "Email do Site Rastro Legal - Habilitações/Divergências", $data, $headers); if (!$send) { echo 'Ocorreu algum erro, tente novamente'; die(); } ?> <META HTTP-EQUIV=REFRESH CONTENT='0; URL=habilitacoes-e-divergencias'> <script type="text/javascript">alert("Mensagem Enviada com Sucesso.");</script> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 125, Position 2 = 127
Branch analysis from position: 125
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 127
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dB6iZ
function name:  (null)
number of ops:  129
compiled vars:  !0 = $emaildestino, !1 = $nome, !2 = $sobrenome, !3 = $email, !4 = $telefone, !5 = $descricao, !6 = $arquivo, !7 = $boundary, !8 = $fp, !9 = $anexo, !10 = $headers, !11 = $data, !12 = $send
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3Chtml%3E%0A%3Chead%3E%0A%3Ctitle%3E+Enviando+E-mail...+%3C%2Ftitle%3E%0A%3Cmeta+charset%3D%22UTF-8%22%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A'
   11     1        FETCH_IS                                         ~13     '_POST'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~14     ~13, 'email'
          3        BOOL_NOT                                         ~15     ~14
          4      > JMPZ                                                     ~15, ->6
   12     5    > > EXIT                                                     
   15     6    >   FETCH_R                      global              ~16     '_POST'
          7        FETCH_DIM_R                                      ~17     ~16, 'subcategoria'
          8        ASSIGN                                                   !0, ~17
   16     9        FETCH_R                      global              ~19     '_POST'
         10        FETCH_DIM_R                                      ~20     ~19, 'nome'
         11        ASSIGN                                                   !1, ~20
   17    12        FETCH_R                      global              ~22     '_POST'
         13        FETCH_DIM_R                                      ~23     ~22, 'sobrenome'
         14        ASSIGN                                                   !2, ~23
   18    15        FETCH_R                      global              ~25     '_POST'
         16        FETCH_DIM_R                                      ~26     ~25, 'email'
         17        ASSIGN                                                   !3, ~26
   19    18        FETCH_R                      global              ~28     '_POST'
         19        FETCH_DIM_R                                      ~29     ~28, 'telefone'
         20        ASSIGN                                                   !4, ~29
   20    21        FETCH_R                      global              ~31     '_POST'
         22        FETCH_DIM_R                                      ~32     ~31, 'mensagem'
         23        ASSIGN                                                   !5, ~32
   21    24        FETCH_R                      global              ~34     '_FILES'
         25        FETCH_DIM_R                                      ~35     ~34, 'arquivo'
         26        ASSIGN                                                   !6, ~35
   24    27        INIT_FCALL                                               'date'
         28        SEND_VAL                                                 'dmYis'
         29        DO_ICALL                                         $37     
         30        CONCAT                                           ~38     'XYZ-', $37
         31        CONCAT                                           ~39     ~38, '-ZYX'
         32        ASSIGN                                                   !7, ~39
   25    33        INIT_FCALL                                               'fopen'
         34        FETCH_DIM_R                                      ~41     !6, 'tmp_name'
         35        SEND_VAL                                                 ~41
         36        SEND_VAL                                                 'rb'
         37        DO_ICALL                                         $42     
         38        ASSIGN                                                   !8, $42
   26    39        INIT_FCALL                                               'fread'
         40        SEND_VAR                                                 !8
         41        INIT_FCALL                                               'filesize'
         42        FETCH_DIM_R                                      ~44     !6, 'tmp_name'
         43        SEND_VAL                                                 ~44
         44        DO_ICALL                                         $45     
         45        SEND_VAR                                                 $45
         46        DO_ICALL                                         $46     
         47        ASSIGN                                                   !9, $46
   27    48        INIT_FCALL                                               'base64_encode'
         49        SEND_VAR                                                 !9
         50        DO_ICALL                                         $48     
         51        ASSIGN                                                   !9, $48
   28    52        INIT_FCALL                                               'fclose'
         53        SEND_VAR                                                 !8
         54        DO_ICALL                                                 
   31    55        ASSIGN                                                   !10, 'MIME-Version%3A+1.0%0A'
   32    56        ASSIGN_OP                                     8          !10, 'Content-Type%3A+multipart%2Fmixed%3B+'
   33    57        ROPE_INIT                                     3  ~54     'boundary%3D%22'
         58        ROPE_ADD                                      1  ~54     ~54, !7
         59        ROPE_END                                      2  ~53     ~54, '%22%0D%0A'
         60        ASSIGN_OP                                     8          !10, ~53
   34    61        ROPE_INIT                                     3  ~58     'From%3A+'
         62        ROPE_ADD                                      1  ~58     ~58, !3
         63        ROPE_END                                      2  ~57     ~58, '%0A'
         64        ASSIGN_OP                                     8          !10, ~57
   35    65        NOP                                                      
         66        FAST_CONCAT                                      ~61     !7, '%0A'
         67        ASSIGN_OP                                     8          !10, ~61
   38    68        ROPE_INIT                                     3  ~64     '--'
         69        ROPE_ADD                                      1  ~64     ~64, !7
         70        ROPE_END                                      2  ~63     ~64, '%0A'
         71        ASSIGN                                                   !11, ~63
   39    72        ASSIGN_OP                                     8          !11, 'Content-Type%3A+text%2Fhtml%3B+charset%3D%27utf-8%27%0A'
   40    73        ROPE_INIT                                     3  ~69     '%3Cstrong%3ENome%3A+%3C%2Fstrong%3E+'
         74        ROPE_ADD                                      1  ~69     ~69, !1
         75        ROPE_END                                      2  ~68     ~69, '+%0D%0A'
         76        ASSIGN_OP                                     8          !11, ~68
   41    77        ROPE_INIT                                     3  ~73     '%3Cstrong%3ESobrenome%3A+%3C%2Fstrong%3E+'
         78        ROPE_ADD                                      1  ~73     ~73, !2
         79        ROPE_END                                      2  ~72     ~73, '+%0D%0A'
         80        ASSIGN_OP                                     8          !11, ~72
   42    81        ROPE_INIT                                     3  ~77     '%3Cstrong%3EE-mail%3A+%3C%2Fstrong%3E+'
         82        ROPE_ADD                                      1  ~77     ~77, !3
         83        ROPE_END                                      2  ~76     ~77, '+%0D%0A'
         84        ASSIGN_OP                                     8          !11, ~76
   43    85        ROPE_INIT                                     3  ~81     '%3Cstrong%3ETelefone%3A+%3C%2Fstrong%3E+'
         86        ROPE_ADD                                      1  ~81     ~81, !4
         87        ROPE_END                                      2  ~80     ~81, '+%0D%0A'
         88        ASSIGN_OP                                     8          !11, ~80
   44    89        ROPE_INIT                                     3  ~85     '%3Cstrong%3EMenssagem%3A+%3C%2Fstrong%3E+'
         90        ROPE_ADD                                      1  ~85     ~85, !5
         91        ROPE_END                                      2  ~84     ~85, '+%0D%0A'
         92        ASSIGN_OP                                     8          !11, ~84
   45    93        ROPE_INIT                                     3  ~89     '--'
         94        ROPE_ADD                                      1  ~89     ~89, !7
         95        ROPE_END                                      2  ~88     ~89, '+%0A'
         96        ASSIGN_OP                                     8          !11, ~88
   48    97        FETCH_DIM_R                                      ~92     !6, 'type'
         98        CONCAT                                           ~93     'Content-Type%3A+', ~92
         99        CONCAT                                           ~94     ~93, '%3B+name%3D'
        100        FETCH_DIM_R                                      ~95     !6, 'name'
        101        CONCAT                                           ~96     ~94, ~95
        102        CONCAT                                           ~97     ~96, '%0A'
        103        ASSIGN_OP                                     8          !11, ~97
   49   104        ASSIGN_OP                                     8          !11, 'Content-Transfer-Encoding%3A+base64+%0A'
   50   105        FETCH_DIM_R                                      ~100    !6, 'name'
        106        CONCAT                                           ~101    'Content-Disposition%3A+attachment%3B+filename%3D', ~100
        107        CONCAT                                           ~102    ~101, '%0D%0A'
        108        ASSIGN_OP                                     8          !11, ~102
   51   109        NOP                                                      
        110        FAST_CONCAT                                      ~104    !9, '+%0A'
        111        ASSIGN_OP                                     8          !11, ~104
   52   112        ROPE_INIT                                     3  ~107    '--'
        113        ROPE_ADD                                      1  ~107    ~107, !7
        114        ROPE_END                                      2  ~106    ~107, '+%0A'
        115        ASSIGN_OP                                     8          !11, ~106
   55   116        INIT_FCALL                                               'mail'
        117        SEND_VAR                                                 !0
        118        SEND_VAL                                                 'Email+do+Site+Rastro+Legal+-+Habilita%C3%A7%C3%B5es%2FDiverg%C3%AAncias'
        119        SEND_VAR                                                 !11
        120        SEND_VAR                                                 !10
        121        DO_ICALL                                         $110    
        122        ASSIGN                                                   !12, $110
   57   123        BOOL_NOT                                         ~112    !12
        124      > JMPZ                                                     ~112, ->127
   58   125    >   ECHO                                                     'Ocorreu+algum+erro%2C+tente+novamente'
   59   126      > EXIT                                                     
   62   127    >   ECHO                                                     '%0A%3CMETA+HTTP-EQUIV%3DREFRESH+CONTENT%3D%270%3B+URL%3Dhabilitacoes-e-divergencias%27%3E%0A%3Cscript+type%3D%22text%2Fjavascript%22%3Ealert%28%22Mensagem+Enviada+com+Sucesso.%22%29%3B%3C%2Fscript%3E%0A%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   67   128      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.68 ms | 1413 KiB | 27 Q