3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "emdheide@upcmail.nl"; $email_subject = "Vraag binnengekomen via website"; function died($error) { // your error code can go here echo "Er zijn fouten ontdekt bij het invullen van het formulier. "; echo "Deze fouten zijn.<br /><br />"; echo $error."<br /><br />"; echo "Ga terug en probeer het opnieuw.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['name']) || !isset($_POST['bname']) || !isset($_POST['tel']) || !isset($_POST['email']) || !isset($_POST['textarea'])) { died('Het spijt ons, het lijkt dat er een probleem is met het formulier dat u hebt verzonden.'); } $name = $_POST['name']; // required $bname = $_POST['bname']; // required $tel = $_POST['tel']; // required $email = $_POST['email']; // not required $textarea = $_POST['textarea']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email)) { $error_message .= 'Het Email Adres klopt niet.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$name)) { $error_message .= 'Vul uw Naam in.<br />'; } if(!preg_match($string_exp,$bname)) { $error_message .= 'Vul uw Bedrijfsnaam in.<br />'; } if(strlen($textarea) < 2) { $error_message .= 'The Comments you entered do not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Naam: ".clean_string($name)."\n"; $email_message .= "Bedrijf: ".clean_string($bname)."\n"; $email_message .= "Telefoon: ".clean_string($tel)."\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Vraag: ".clean_string($textarea)."\n"; // create email headers $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); header('Location:bedankt.html'); exit(); ?> <!-- include your own success html here --> <?php } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 136
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 47) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
2 jumps found. (Code = 47) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
2 jumps found. (Code = 47) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 33
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 57
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 65
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 72
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 75, Position 2 = 76
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 79, Position 2 = 82
Branch analysis from position: 79
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 82
Branch analysis from position: 76
Branch analysis from position: 72
Branch analysis from position: 65
Branch analysis from position: 57
Branch analysis from position: 33
Branch analysis from position: 29
Branch analysis from position: 24
Branch analysis from position: 19
Branch analysis from position: 14
Branch analysis from position: 136
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Sis1
function name:  (null)
number of ops:  137
compiled vars:  !0 = $email_to, !1 = $email_subject, !2 = $name, !3 = $bname, !4 = $tel, !5 = $email, !6 = $textarea, !7 = $error_message, !8 = $email_exp, !9 = $string_exp, !10 = $email_message, !11 = $headers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_IS                                         ~12     '_POST'
          1        ISSET_ISEMPTY_DIM_OBJ                         0          ~12, 'email'
          2      > JMPZ                                                     ~13, ->136
    9     3    >   ASSIGN                                                   !0, 'emdheide%40upcmail.nl'
   11     4        ASSIGN                                                   !1, 'Vraag+binnengekomen+via+website'
   17     5        DECLARE_FUNCTION                                         'died'
   37     6        FETCH_IS                                         ~16     '_POST'
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~17     ~16, 'name'
          8        BOOL_NOT                                         ~18     ~17
          9      > JMPNZ_EX                                         ~18     ~18, ->14
   39    10    >   FETCH_IS                                         ~19     '_POST'
         11        ISSET_ISEMPTY_DIM_OBJ                         0  ~20     ~19, 'bname'
         12        BOOL_NOT                                         ~21     ~20
         13        BOOL                                             ~18     ~21
         14    > > JMPNZ_EX                                         ~18     ~18, ->19
   41    15    >   FETCH_IS                                         ~22     '_POST'
         16        ISSET_ISEMPTY_DIM_OBJ                         0  ~23     ~22, 'tel'
         17        BOOL_NOT                                         ~24     ~23
         18        BOOL                                             ~18     ~24
         19    > > JMPNZ_EX                                         ~18     ~18, ->24
   43    20    >   FETCH_IS                                         ~25     '_POST'
         21        ISSET_ISEMPTY_DIM_OBJ                         0  ~26     ~25, 'email'
         22        BOOL_NOT                                         ~27     ~26
         23        BOOL                                             ~18     ~27
         24    > > JMPNZ_EX                                         ~18     ~18, ->29
   45    25    >   FETCH_IS                                         ~28     '_POST'
         26        ISSET_ISEMPTY_DIM_OBJ                         0  ~29     ~28, 'textarea'
         27        BOOL_NOT                                         ~30     ~29
         28        BOOL                                             ~18     ~30
         29    > > JMPZ                                                     ~18, ->33
   47    30    >   INIT_FCALL_BY_NAME                                       'died'
         31        SEND_VAL_EX                                              'Het+spijt+ons%2C+het+lijkt+dat+er+een+probleem+is+met+het+formulier+dat+u+hebt+verzonden.'
         32        DO_FCALL                                      0          
   53    33    >   FETCH_R                      global              ~32     '_POST'
         34        FETCH_DIM_R                                      ~33     ~32, 'name'
         35        ASSIGN                                                   !2, ~33
   55    36        FETCH_R                      global              ~35     '_POST'
         37        FETCH_DIM_R                                      ~36     ~35, 'bname'
         38        ASSIGN                                                   !3, ~36
   57    39        FETCH_R                      global              ~38     '_POST'
         40        FETCH_DIM_R                                      ~39     ~38, 'tel'
         41        ASSIGN                                                   !4, ~39
   59    42        FETCH_R                      global              ~41     '_POST'
         43        FETCH_DIM_R                                      ~42     ~41, 'email'
         44        ASSIGN                                                   !5, ~42
   61    45        FETCH_R                      global              ~44     '_POST'
         46        FETCH_DIM_R                                      ~45     ~44, 'textarea'
         47        ASSIGN                                                   !6, ~45
   67    48        ASSIGN                                                   !7, ''
   69    49        ASSIGN                                                   !8, '%2F%5E%5BA-Za-z0-9._%25-%5D%2B%40%5BA-Za-z0-9.-%5D%2B%5C.%5BA-Za-z%5D%7B2%2C4%7D%24%2F'
   71    50        INIT_FCALL                                               'preg_match'
         51        SEND_VAR                                                 !8
         52        SEND_VAR                                                 !5
         53        DO_ICALL                                         $49     
         54        BOOL_NOT                                         ~50     $49
         55      > JMPZ                                                     ~50, ->57
   73    56    >   ASSIGN_OP                                     8          !7, 'Het+Email+Adres+klopt+niet.%3Cbr+%2F%3E'
   77    57    >   ASSIGN                                                   !9, '%2F%5E%5BA-Za-z+.%27-%5D%2B%24%2F'
   79    58        INIT_FCALL                                               'preg_match'
         59        SEND_VAR                                                 !9
         60        SEND_VAR                                                 !2
         61        DO_ICALL                                         $53     
         62        BOOL_NOT                                         ~54     $53
         63      > JMPZ                                                     ~54, ->65
   81    64    >   ASSIGN_OP                                     8          !7, 'Vul+uw+Naam+in.%3Cbr+%2F%3E'
   85    65    >   INIT_FCALL                                               'preg_match'
         66        SEND_VAR                                                 !9
         67        SEND_VAR                                                 !3
         68        DO_ICALL                                         $56     
         69        BOOL_NOT                                         ~57     $56
         70      > JMPZ                                                     ~57, ->72
   87    71    >   ASSIGN_OP                                     8          !7, 'Vul+uw+Bedrijfsnaam+in.%3Cbr+%2F%3E'
   91    72    >   STRLEN                                           ~59     !6
         73        IS_SMALLER                                               ~59, 2
         74      > JMPZ                                                     ~60, ->76
   93    75    >   ASSIGN_OP                                     8          !7, 'The+Comments+you+entered+do+not+appear+to+be+valid.%3Cbr+%2F%3E'
   97    76    >   STRLEN                                           ~62     !7
         77        IS_SMALLER                                               0, ~62
         78      > JMPZ                                                     ~63, ->82
   99    79    >   INIT_FCALL_BY_NAME                                       'died'
         80        SEND_VAR_EX                                              !7
         81        DO_FCALL                                      0          
  104    82    >   DECLARE_FUNCTION                                         'clean_string'
  114    83        INIT_FCALL_BY_NAME                                       'clean_string'
         84        SEND_VAR_EX                                              !2
         85        DO_FCALL                                      0  $65     
         86        CONCAT                                           ~66     'Naam%3A+', $65
         87        CONCAT                                           ~67     ~66, '%0A'
         88        ASSIGN_OP                                     8          !10, ~67
  116    89        INIT_FCALL_BY_NAME                                       'clean_string'
         90        SEND_VAR_EX                                              !3
         91        DO_FCALL                                      0  $69     
         92        CONCAT                                           ~70     'Bedrijf%3A+', $69
         93        CONCAT                                           ~71     ~70, '%0A'
         94        ASSIGN_OP                                     8          !10, ~71
  118    95        INIT_FCALL_BY_NAME                                       'clean_string'
         96        SEND_VAR_EX                                              !4
         97        DO_FCALL                                      0  $73     
         98        CONCAT                                           ~74     'Telefoon%3A+', $73
         99        CONCAT                                           ~75     ~74, '%0A'
        100        ASSIGN_OP                                     8          !10, ~75
  120   101        INIT_FCALL_BY_NAME                                       'clean_string'
        102        SEND_VAR_EX                                              !5
        103        DO_FCALL                                      0  $77     
        104        CONCAT                                           ~78     'Email%3A+', $77
        105        CONCAT                                           ~79     ~78, '%0A'
        106        ASSIGN_OP                                     8          !10, ~79
  122   107        INIT_FCALL_BY_NAME                                       'clean_string'
        108        SEND_VAR_EX                                              !6
        109        DO_FCALL                                      0  $81     
        110        CONCAT                                           ~82     'Vraag%3A+', $81
        111        CONCAT                                           ~83     ~82, '%0A'
        112        ASSIGN_OP                                     8          !10, ~83
  130   113        CONCAT                                           ~85     'From%3A+', !5
        114        CONCAT                                           ~86     ~85, '%0D%0A'
  132   115        CONCAT                                           ~87     ~86, 'Reply-To%3A+'
        116        CONCAT                                           ~88     ~87, !5
        117        CONCAT                                           ~89     ~88, '%0D%0A'
  134   118        CONCAT                                           ~90     ~89, 'X-Mailer%3A+PHP%2F'
        119        INIT_FCALL                                               'phpversion'
        120        DO_ICALL                                         $91     
        121        CONCAT                                           ~92     ~90, $91
  130   122        ASSIGN                                                   !11, ~92
  136   123        BEGIN_SILENCE                                    ~94     
        124        INIT_FCALL                                               'mail'
        125        SEND_VAR                                                 !0
        126        SEND_VAR                                                 !1
        127        SEND_VAR                                                 !10
        128        SEND_VAR                                                 !11
        129        DO_ICALL                                                 
        130        END_SILENCE                                              ~94
  137   131        INIT_FCALL                                               'header'
        132        SEND_VAL                                                 'Location%3Abedankt.html'
        133        DO_ICALL                                                 
  138   134      > EXIT                                                     
  140   135*       ECHO                                                     '+%0A+%0A+%0A%3C%21--+include+your+own+success+html+here+--%3E%0A%0A%0A%0A%0A+%0A'
  153   136    > > RETURN                                                   1

Function %00died%2Fin%2F1Sis1%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/1Sis1
function name:  died
number of ops:  8
compiled vars:  !0 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   21     1        ECHO                                                     'Er+zijn+fouten+ontdekt+bij+het+invullen+van+het+formulier.+'
   23     2        ECHO                                                     'Deze+fouten+zijn.%3Cbr+%2F%3E%3Cbr+%2F%3E'
   25     3        CONCAT                                           ~1      !0, '%3Cbr+%2F%3E%3Cbr+%2F%3E'
          4        ECHO                                                     ~1
   27     5        ECHO                                                     'Ga+terug+en+probeer+het+opnieuw.%3Cbr+%2F%3E%3Cbr+%2F%3E'
   29     6      > EXIT                                                     
   31     7*     > RETURN                                                   null

End of function %00died%2Fin%2F1Sis1%3A17%240

Function %00clean_string%2Fin%2F1Sis1%3A104%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Sis1
function name:  clean_string
number of ops:  9
compiled vars:  !0 = $string, !1 = $bad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  104     0  E >   RECV                                             !0      
  106     1        ASSIGN                                                   !1, <array>
  108     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
  110     8*     > RETURN                                                   null

End of function %00clean_string%2Fin%2F1Sis1%3A104%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.56 ms | 1412 KiB | 23 Q