3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Define some constants define( "RECIPIENT_NAME", "Kitchen Interiors" ); define( "RECIPIENT_EMAIL", "info@kitcheninteriors.ca" ); define( "EMAIL_SUBJECT", "Kitchen Interiors - Visitor Message" ); // Read the form values $success = false; $senderName = isset( $_POST['senderName'] ) ? preg_replace( "/[^\.\-\' a-zA-Z0-9]/", "", $_POST['senderName'] ) : ""; $senderEmail = isset( $_POST['senderEmail'] ) ? preg_replace( "/[^\.\-\_\@a-zA-Z0-9]/", "", $_POST['senderEmail'] ) : ""; $message = isset( $_POST['message'] ) ? preg_replace( "/(From:|To:|BCC:|CC:|Subject:|Content-Type:)/", "", $_POST['message'] ) : ""; $messagecontent = "\r\n Name:" . $senderName . "\r\n Email:" . $senderEmail . "\r\n Message:" . $message; $SpamErrorMessage = "No Websites URLs permitted"; if(preg_match("/http/i", "$senderName")) {echo "$SpamErrorMessage"; exit();} if(preg_match("/http/i", "$senderEmail")) {echo "$SpamErrorMessage"; exit();} if(preg_match("/http/i", "$message")) {echo "$SpamErrorMessage"; exit();} $recipient = RECIPIENT_NAME . " <" . RECIPIENT_EMAIL . ">"; $headers = "From: " . $senderName . " <" . $senderEmail . ">"; $success = mail( $recipient, EMAIL_SUBJECT, $messagecontent, $headers ); ?> <html> <head> <title>Thank You</title> </head> <body style="background-color:#1b1b1b;"> <div style="margin-left:auto; margin-right:auto; margin-top:200px; text-align:center; color:#fff !important; font-size:24px; line-height:30px; font-weight:bold; font-family:Arial;"> <?php if ( $success ) echo "<p>Thanks for sending your message! We'll get back to you shortly.</p>" ?> <?php if ( !$success ) echo "<p>There was a problem sending your message. Please try again.</p>" ?> <p>Click your browser's Back button to return to the page.</p> </div> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 39
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 53
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 71
Branch analysis from position: 68
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 77, Position 2 = 80
Branch analysis from position: 77
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 80
2 jumps found. (Code = 43) Position 1 = 86, Position 2 = 89
Branch analysis from position: 86
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 89
2 jumps found. (Code = 43) Position 1 = 110, Position 2 = 111
Branch analysis from position: 110
2 jumps found. (Code = 43) Position 1 = 114, Position 2 = 115
Branch analysis from position: 114
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 115
Branch analysis from position: 111
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 71
Branch analysis from position: 68
Branch analysis from position: 71
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 53
Branch analysis from position: 44
Branch analysis from position: 53
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 39
Branch analysis from position: 30
Branch analysis from position: 39
filename:       /in/VqA88
function name:  (null)
number of ops:  117
compiled vars:  !0 = $success, !1 = $senderName, !2 = $senderEmail, !3 = $message, !4 = $messagecontent, !5 = $SpamErrorMessage, !6 = $recipient, !7 = $headers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'RECIPIENT_NAME'
          2        SEND_VAL                                                 'Kitchen+Interiors'
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'RECIPIENT_EMAIL'
          6        SEND_VAL                                                 'info%40kitcheninteriors.ca'
          7        DO_ICALL                                                 
    6     8        INIT_FCALL                                               'define'
          9        SEND_VAL                                                 'EMAIL_SUBJECT'
         10        SEND_VAL                                                 'Kitchen+Interiors+-+Visitor+Message'
         11        DO_ICALL                                                 
    9    12        ASSIGN                                                   !0, <false>
   10    13        FETCH_IS                                         ~12     '_POST'
         14        ISSET_ISEMPTY_DIM_OBJ                         0          ~12, 'senderName'
         15      > JMPZ                                                     ~13, ->25
         16    >   INIT_FCALL                                               'preg_replace'
         17        SEND_VAL                                                 '%2F%5B%5E%5C.%5C-%5C%27+a-zA-Z0-9%5D%2F'
         18        SEND_VAL                                                 ''
         19        FETCH_R                      global              ~14     '_POST'
         20        FETCH_DIM_R                                      ~15     ~14, 'senderName'
         21        SEND_VAL                                                 ~15
         22        DO_ICALL                                         $16     
         23        QM_ASSIGN                                        ~17     $16
         24      > JMP                                                      ->26
         25    >   QM_ASSIGN                                        ~17     ''
         26    >   ASSIGN                                                   !1, ~17
   11    27        FETCH_IS                                         ~19     '_POST'
         28        ISSET_ISEMPTY_DIM_OBJ                         0          ~19, 'senderEmail'
         29      > JMPZ                                                     ~20, ->39
         30    >   INIT_FCALL                                               'preg_replace'
         31        SEND_VAL                                                 '%2F%5B%5E%5C.%5C-%5C_%5C%40a-zA-Z0-9%5D%2F'
         32        SEND_VAL                                                 ''
         33        FETCH_R                      global              ~21     '_POST'
         34        FETCH_DIM_R                                      ~22     ~21, 'senderEmail'
         35        SEND_VAL                                                 ~22
         36        DO_ICALL                                         $23     
         37        QM_ASSIGN                                        ~24     $23
         38      > JMP                                                      ->40
         39    >   QM_ASSIGN                                        ~24     ''
         40    >   ASSIGN                                                   !2, ~24
   12    41        FETCH_IS                                         ~26     '_POST'
         42        ISSET_ISEMPTY_DIM_OBJ                         0          ~26, 'message'
         43      > JMPZ                                                     ~27, ->53
         44    >   INIT_FCALL                                               'preg_replace'
         45        SEND_VAL                                                 '%2F%28From%3A%7CTo%3A%7CBCC%3A%7CCC%3A%7CSubject%3A%7CContent-Type%3A%29%2F'
         46        SEND_VAL                                                 ''
         47        FETCH_R                      global              ~28     '_POST'
         48        FETCH_DIM_R                                      ~29     ~28, 'message'
         49        SEND_VAL                                                 ~29
         50        DO_ICALL                                         $30     
         51        QM_ASSIGN                                        ~31     $30
         52      > JMP                                                      ->54
         53    >   QM_ASSIGN                                        ~31     ''
         54    >   ASSIGN                                                   !3, ~31
   14    55        CONCAT                                           ~33     '%0D%0A+Name%3A', !1
         56        CONCAT                                           ~34     ~33, '%0D%0A+Email%3A'
         57        CONCAT                                           ~35     ~34, !2
         58        CONCAT                                           ~36     ~35, '%0D%0A+Message%3A'
         59        CONCAT                                           ~37     ~36, !3
         60        ASSIGN                                                   !4, ~37
   16    61        ASSIGN                                                   !5, 'No+Websites+URLs+permitted'
   17    62        INIT_FCALL                                               'preg_match'
         63        SEND_VAL                                                 '%2Fhttp%2Fi'
         64        CAST                                          6  ~40     !1
         65        SEND_VAL                                                 ~40
         66        DO_ICALL                                         $41     
         67      > JMPZ                                                     $41, ->71
         68    >   CAST                                          6  ~42     !5
         69        ECHO                                                     ~42
         70      > EXIT                                                     
   18    71    >   INIT_FCALL                                               'preg_match'
         72        SEND_VAL                                                 '%2Fhttp%2Fi'
         73        CAST                                          6  ~43     !2
         74        SEND_VAL                                                 ~43
         75        DO_ICALL                                         $44     
         76      > JMPZ                                                     $44, ->80
         77    >   CAST                                          6  ~45     !5
         78        ECHO                                                     ~45
         79      > EXIT                                                     
   19    80    >   INIT_FCALL                                               'preg_match'
         81        SEND_VAL                                                 '%2Fhttp%2Fi'
         82        CAST                                          6  ~46     !3
         83        SEND_VAL                                                 ~46
         84        DO_ICALL                                         $47     
         85      > JMPZ                                                     $47, ->89
         86    >   CAST                                          6  ~48     !5
         87        ECHO                                                     ~48
         88      > EXIT                                                     
   21    89    >   FETCH_CONSTANT                                   ~49     'RECIPIENT_NAME'
         90        CONCAT                                           ~50     ~49, '+%3C'
         91        FETCH_CONSTANT                                   ~51     'RECIPIENT_EMAIL'
         92        CONCAT                                           ~52     ~50, ~51
         93        CONCAT                                           ~53     ~52, '%3E'
         94        ASSIGN                                                   !6, ~53
   22    95        CONCAT                                           ~55     'From%3A+', !1
         96        CONCAT                                           ~56     ~55, '+%3C'
         97        CONCAT                                           ~57     ~56, !2
         98        CONCAT                                           ~58     ~57, '%3E'
         99        ASSIGN                                                   !7, ~58
   23   100        INIT_FCALL                                               'mail'
        101        SEND_VAR                                                 !6
        102        FETCH_CONSTANT                                   ~60     'EMAIL_SUBJECT'
        103        SEND_VAL                                                 ~60
        104        SEND_VAR                                                 !4
        105        SEND_VAR                                                 !7
        106        DO_ICALL                                         $61     
        107        ASSIGN                                                   !0, $61
   26   108        ECHO                                                     '%3Chtml%3E%0A++%3Chead%3E%0A++++%3Ctitle%3EThank+You%3C%2Ftitle%3E%0A++%3C%2Fhead%3E%0A++%3Cbody+style%3D%22background-color%3A%231b1b1b%3B%22%3E%0A++%3Cdiv+style%3D%22margin-left%3Aauto%3B+margin-right%3Aauto%3B+margin-top%3A200px%3B+text-align%3Acenter%3B+color%3A%23fff+%21important%3B+font-size%3A24px%3B+line-height%3A30px%3B+font-weight%3Abold%3B+font-family%3AArial%3B%22%3E%0A++'
   32   109      > JMPZ                                                     !0, ->111
        110    >   ECHO                                                     '%3Cp%3EThanks+for+sending+your+message%21+We%27ll+get+back+to+you+shortly.%3C%2Fp%3E'
   33   111    >   ECHO                                                     '++'
        112        BOOL_NOT                                         ~63     !0
        113      > JMPZ                                                     ~63, ->115
        114    >   ECHO                                                     '%3Cp%3EThere+was+a+problem+sending+your+message.+Please+try+again.%3C%2Fp%3E'
   34   115    >   ECHO                                                     '++%3Cp%3EClick+your+browser%27s+Back+button+to+return+to+the+page.%3C%2Fp%3E%0A++%3C%2Fdiv%3E%0A++%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   37   116      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.54 ms | 1400 KiB | 21 Q