3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset ($_POST["send"])) { $upload_name=$_FILES["upload"]["name"]; $upload_type=$_FILES["upload"]["type"]; $upload_size=$_FILES["upload"]["size"]; $upload_temp=$_FILES["upload"]["tmp_name"]; $message=$_POST["msg"]; $subject = $_POST["subject"]; $to=$_POST["to"]; $from=$_POST["from"]; if($message==""||$subject==""||$to==""||$from=="") { echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#F3363F; font-weight:bold">Please fill all fields</font>'; } else { $fp = fopen($upload_temp, "rb"); $file = fread($fp, $upload_size); $file = chunk_split(base64_encode($file)); $num = md5(time()); //Normal headers $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/mixed; "; $headers .= "boundary=".$num."\r\n"; $headers .= "--$num\r\n"; $headers ="Return-Path: <".clean_msg($from).">\n"; $headers .="From: ".clean_msg($from)." <".clean_msg($youremail).">\n"; $headers .="X-Mailer: PHP/".phpversion()."\n"; $headers .="X-Sender: ".$_SERVER['REMOTE_ADDR']."\n"; // This two steps to help avoid spam $headers .= "Message-ID: <".gettimeofday()." TheSystem@".$_SERVER['SERVER_NAME'].">\r\n"; $headers .= "X-Mailer: PHP v".phpversion()."\r\n"; // With message $headers .= "Content-Type: text/html; charset=iso-8859-1\r\n"; $headers .= "Content-Transfer-Encoding: 8bit\r\n"; $headers .= "".$message."\n"; $headers .= "--".$num."\n"; // Attachment headers $headers .= "Content-Type:".$upload_type." "; $headers .= "name=\"".$upload_name."\"r\n"; $headers .= "Content-Transfer-Encoding: base64\r\n"; $headers .= "Content-Disposition: attachment; "; $headers .= "filename=\"".$upload_name."\"\r\n\n"; $headers .= "".$file."\r\n"; $headers .= "--".$num."--"; // SEND MAIL @mail($to, $subject, $message, $headers); fclose($fp); echo '<font style="font-family:Verdana, Arial; font-size:11px; color:#333333; font-weight:bold">Mail sent please check inbox and spam both <br /></font>'; } } ?> <form id="attach" name="attach" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" enctype="multipart/form-data"> <table> <tr> <td>From</td><td>:</td><td><input type="text" name="from" id="from"></td> </tr> <tr> <td>To</td><td>:</td><td><input type="text" name="to" id="to"></td> </tr> <tr> <td>Subject</td><td>:</td><td><input type="text" name="subject" id="subject"></td> </tr> <tr> <td>Message</td><td>:</td><td><input type="text" name="msg" id="msg"></td> </tr> <tr> <td>Attachment<span class="imp">*</span></td><td>:</td><td><input type="file" name="upload" id="upload"></td> </tr> <tr> <td></td><td></td><td><input type="submit" value="Submit" id="send" name="send"></td> </tr> </table> </form>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 154
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
2 jumps found. (Code = 47) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
2 jumps found. (Code = 47) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 154
Branch analysis from position: 154
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 38
Branch analysis from position: 35
Branch analysis from position: 154
filename:       /in/MsotD
function name:  (null)
number of ops:  160
compiled vars:  !0 = $upload_name, !1 = $upload_type, !2 = $upload_size, !3 = $upload_temp, !4 = $message, !5 = $subject, !6 = $to, !7 = $from, !8 = $fp, !9 = $file, !10 = $num, !11 = $headers, !12 = $youremail
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_IS                                         ~13     '_POST'
          1        ISSET_ISEMPTY_DIM_OBJ                         0          ~13, 'send'
          2      > JMPZ                                                     ~14, ->154
    5     3    >   FETCH_R                      global              ~15     '_FILES'
          4        FETCH_DIM_R                                      ~16     ~15, 'upload'
          5        FETCH_DIM_R                                      ~17     ~16, 'name'
          6        ASSIGN                                                   !0, ~17
    6     7        FETCH_R                      global              ~19     '_FILES'
          8        FETCH_DIM_R                                      ~20     ~19, 'upload'
          9        FETCH_DIM_R                                      ~21     ~20, 'type'
         10        ASSIGN                                                   !1, ~21
    7    11        FETCH_R                      global              ~23     '_FILES'
         12        FETCH_DIM_R                                      ~24     ~23, 'upload'
         13        FETCH_DIM_R                                      ~25     ~24, 'size'
         14        ASSIGN                                                   !2, ~25
    8    15        FETCH_R                      global              ~27     '_FILES'
         16        FETCH_DIM_R                                      ~28     ~27, 'upload'
         17        FETCH_DIM_R                                      ~29     ~28, 'tmp_name'
         18        ASSIGN                                                   !3, ~29
    9    19        FETCH_R                      global              ~31     '_POST'
         20        FETCH_DIM_R                                      ~32     ~31, 'msg'
         21        ASSIGN                                                   !4, ~32
   10    22        FETCH_R                      global              ~34     '_POST'
         23        FETCH_DIM_R                                      ~35     ~34, 'subject'
         24        ASSIGN                                                   !5, ~35
   11    25        FETCH_R                      global              ~37     '_POST'
         26        FETCH_DIM_R                                      ~38     ~37, 'to'
         27        ASSIGN                                                   !6, ~38
   12    28        FETCH_R                      global              ~40     '_POST'
         29        FETCH_DIM_R                                      ~41     ~40, 'from'
         30        ASSIGN                                                   !7, ~41
   14    31        IS_EQUAL                                         ~43     !4, ''
         32      > JMPNZ_EX                                         ~43     ~43, ->35
         33    >   IS_EQUAL                                         ~44     !5, ''
         34        BOOL                                             ~43     ~44
         35    > > JMPNZ_EX                                         ~43     ~43, ->38
         36    >   IS_EQUAL                                         ~45     !6, ''
         37        BOOL                                             ~43     ~45
         38    > > JMPNZ_EX                                         ~43     ~43, ->41
         39    >   IS_EQUAL                                         ~46     !7, ''
         40        BOOL                                             ~43     ~46
         41    > > JMPZ                                                     ~43, ->44
   16    42    >   ECHO                                                     '%3Cfont+style%3D%22font-family%3AVerdana%2C+Arial%3B+font-size%3A11px%3B+color%3A%23F3363F%3B+font-weight%3Abold%22%3EPlease+fill+all+fields%3C%2Ffont%3E'
         43      > JMP                                                      ->154
   20    44    >   INIT_FCALL                                               'fopen'
         45        SEND_VAR                                                 !3
         46        SEND_VAL                                                 'rb'
         47        DO_ICALL                                         $47     
         48        ASSIGN                                                   !8, $47
   21    49        INIT_FCALL                                               'fread'
         50        SEND_VAR                                                 !8
         51        SEND_VAR                                                 !2
         52        DO_ICALL                                         $49     
         53        ASSIGN                                                   !9, $49
   23    54        INIT_FCALL                                               'chunk_split'
         55        INIT_FCALL                                               'base64_encode'
         56        SEND_VAR                                                 !9
         57        DO_ICALL                                         $51     
         58        SEND_VAR                                                 $51
         59        DO_ICALL                                         $52     
         60        ASSIGN                                                   !9, $52
   24    61        INIT_FCALL                                               'md5'
         62        INIT_FCALL                                               'time'
         63        DO_ICALL                                         $54     
         64        SEND_VAR                                                 $54
         65        DO_ICALL                                         $55     
         66        ASSIGN                                                   !10, $55
   28    67        ASSIGN_OP                                     8          !11, 'MIME-Version%3A+1.0%0D%0A'
   29    68        ASSIGN_OP                                     8          !11, 'Content-Type%3A+multipart%2Fmixed%3B+'
   30    69        CONCAT                                           ~59     'boundary%3D', !10
         70        CONCAT                                           ~60     ~59, '%0D%0A'
         71        ASSIGN_OP                                     8          !11, ~60
   31    72        ROPE_INIT                                     3  ~63     '--'
         73        ROPE_ADD                                      1  ~63     ~63, !10
         74        ROPE_END                                      2  ~62     ~63, '%0D%0A'
         75        ASSIGN_OP                                     8          !11, ~62
   32    76        INIT_FCALL_BY_NAME                                       'clean_msg'
         77        SEND_VAR_EX                                              !7
         78        DO_FCALL                                      0  $66     
         79        CONCAT                                           ~67     'Return-Path%3A+%3C', $66
         80        CONCAT                                           ~68     ~67, '%3E%0A'
         81        ASSIGN                                                   !11, ~68
   33    82        INIT_FCALL_BY_NAME                                       'clean_msg'
         83        SEND_VAR_EX                                              !7
         84        DO_FCALL                                      0  $70     
         85        CONCAT                                           ~71     'From%3A+', $70
         86        CONCAT                                           ~72     ~71, '+%3C'
         87        INIT_FCALL_BY_NAME                                       'clean_msg'
         88        SEND_VAR_EX                                              !12
         89        DO_FCALL                                      0  $73     
         90        CONCAT                                           ~74     ~72, $73
         91        CONCAT                                           ~75     ~74, '%3E%0A'
         92        ASSIGN_OP                                     8          !11, ~75
   34    93        INIT_FCALL                                               'phpversion'
         94        DO_ICALL                                         $77     
         95        CONCAT                                           ~78     'X-Mailer%3A+PHP%2F', $77
         96        CONCAT                                           ~79     ~78, '%0A'
         97        ASSIGN_OP                                     8          !11, ~79
   35    98        FETCH_R                      global              ~81     '_SERVER'
         99        FETCH_DIM_R                                      ~82     ~81, 'REMOTE_ADDR'
        100        CONCAT                                           ~83     'X-Sender%3A+', ~82
        101        CONCAT                                           ~84     ~83, '%0A'
        102        ASSIGN_OP                                     8          !11, ~84
   39   103        INIT_FCALL                                               'gettimeofday'
        104        DO_ICALL                                         $86     
        105        CONCAT                                           ~87     'Message-ID%3A+%3C', $86
        106        CONCAT                                           ~88     ~87, '+TheSystem%40'
        107        FETCH_R                      global              ~89     '_SERVER'
        108        FETCH_DIM_R                                      ~90     ~89, 'SERVER_NAME'
        109        CONCAT                                           ~91     ~88, ~90
        110        CONCAT                                           ~92     ~91, '%3E%0D%0A'
        111        ASSIGN_OP                                     8          !11, ~92
   40   112        INIT_FCALL                                               'phpversion'
        113        DO_ICALL                                         $94     
        114        CONCAT                                           ~95     'X-Mailer%3A+PHP+v', $94
        115        CONCAT                                           ~96     ~95, '%0D%0A'
        116        ASSIGN_OP                                     8          !11, ~96
   44   117        ASSIGN_OP                                     8          !11, 'Content-Type%3A+text%2Fhtml%3B+charset%3Diso-8859-1%0D%0A'
   45   118        ASSIGN_OP                                     8          !11, 'Content-Transfer-Encoding%3A+8bit%0D%0A'
   46   119        CONCAT                                           ~100    '', !4
        120        CONCAT                                           ~101    ~100, '%0A'
        121        ASSIGN_OP                                     8          !11, ~101
   47   122        CONCAT                                           ~103    '--', !10
        123        CONCAT                                           ~104    ~103, '%0A'
        124        ASSIGN_OP                                     8          !11, ~104
   51   125        CONCAT                                           ~106    'Content-Type%3A', !1
        126        CONCAT                                           ~107    ~106, '+'
        127        ASSIGN_OP                                     8          !11, ~107
   52   128        CONCAT                                           ~109    'name%3D%22', !0
        129        CONCAT                                           ~110    ~109, '%22r%0A'
        130        ASSIGN_OP                                     8          !11, ~110
   53   131        ASSIGN_OP                                     8          !11, 'Content-Transfer-Encoding%3A+base64%0D%0A'
   54   132        ASSIGN_OP                                     8          !11, 'Content-Disposition%3A+attachment%3B+'
   55   133        CONCAT                                           ~114    'filename%3D%22', !0
        134        CONCAT                                           ~115    ~114, '%22%0D%0A%0A'
        135        ASSIGN_OP                                     8          !11, ~115
   56   136        CONCAT                                           ~117    '', !9
        137        CONCAT                                           ~118    ~117, '%0D%0A'
        138        ASSIGN_OP                                     8          !11, ~118
   57   139        CONCAT                                           ~120    '--', !10
        140        CONCAT                                           ~121    ~120, '--'
        141        ASSIGN_OP                                     8          !11, ~121
   63   142        BEGIN_SILENCE                                    ~123    
        143        INIT_FCALL                                               'mail'
        144        SEND_VAR                                                 !6
        145        SEND_VAR                                                 !5
        146        SEND_VAR                                                 !4
        147        SEND_VAR                                                 !11
        148        DO_ICALL                                                 
        149        END_SILENCE                                              ~123
   66   150        INIT_FCALL                                               'fclose'
        151        SEND_VAR                                                 !8
        152        DO_ICALL                                                 
   68   153        ECHO                                                     '%3Cfont+style%3D%22font-family%3AVerdana%2C+Arial%3B+font-size%3A11px%3B+color%3A%23333333%3B+font-weight%3Abold%22%3EMail+sent+please+check+inbox+and+spam+both+%3Cbr+%2F%3E%3C%2Ffont%3E'
   73   154    >   ECHO                                                     '%0A%3Cform+id%3D%22attach%22+name%3D%22attach%22+method%3D%22post%22+action%3D%22'
   74   155        FETCH_R                      global              ~126    '_SERVER'
        156        FETCH_DIM_R                                      ~127    ~126, 'PHP_SELF'
        157        ECHO                                                     ~127
        158        ECHO                                                     '%22+enctype%3D%22multipart%2Fform-data%22%3E%0A++++++++++++++++%3Ctable%3E%0A%3Ctr%3E++++++++++++++++++++%0A%3Ctd%3EFrom%3C%2Ftd%3E%3Ctd%3E%3A%3C%2Ftd%3E%3Ctd%3E%3Cinput+type%3D%22text%22+name%3D%22from%22+id%3D%22from%22%3E%3C%2Ftd%3E%0A%3C%2Ftr%3E%0A%3Ctr%3E%0A++++++++++++++++++++++++%3Ctd%3ETo%3C%2Ftd%3E%3Ctd%3E%3A%3C%2Ftd%3E%3Ctd%3E%3Cinput+type%3D%22text%22+name%3D%22to%22+id%3D%22to%22%3E%3C%2Ftd%3E%0A++++++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++++++%3Ctd%3ESubject%3C%2Ftd%3E%3Ctd%3E%3A%3C%2Ftd%3E%3Ctd%3E%3Cinput+type%3D%22text%22+name%3D%22subject%22+id%3D%22subject%22%3E%3C%2Ftd%3E%0A++++++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++++++%3Ctd%3EMessage%3C%2Ftd%3E%3Ctd%3E%3A%3C%2Ftd%3E%3Ctd%3E%3Cinput+type%3D%22text%22+name%3D%22msg%22+id%3D%22msg%22%3E%3C%2Ftd%3E%0A++++++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++++++%3Ctd%3EAttachment%3Cspan+class%3D%22imp%22%3E%2A%3C%2Fspan%3E%3C%2Ftd%3E%3Ctd%3E%3A%3C%2Ftd%3E%3Ctd%3E%3Cinput+type%3D%22file%22+name%3D%22upload%22+id%3D%22upload%22%3E%3C%2Ftd%3E%0A++++++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++++++%3Ctd%3E%3C%2Ftd%3E%3Ctd%3E%3C%2Ftd%3E%3Ctd%3E%3Cinput+type%3D%22submit%22+value%3D%22Submit%22+id%3D%22send%22+name%3D%22send%22%3E%3C%2Ftd%3E%0A++++++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++%3C%2Ftable%3E%0A++++++++++++++++%3C%2Fform%3E'
   95   159      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.78 ms | 1412 KiB | 33 Q