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 @mail($email_to, $email_subject, $email_message); 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 = 125
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: 125
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IpKDs
function name:  (null)
number of ops:  126
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
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_IS                                         ~11     '_POST'
          1        ISSET_ISEMPTY_DIM_OBJ                         0          ~11, 'email'
          2      > JMPZ                                                     ~12, ->125
    9     3    >   ASSIGN                                                   !0, 'emdheide%40upcmail.nl'
   11     4        ASSIGN                                                   !1, 'Vraag+binnengekomen+via+website'
   17     5        DECLARE_FUNCTION                                         'died'
   37     6        FETCH_IS                                         ~15     '_POST'
          7        ISSET_ISEMPTY_DIM_OBJ                         0  ~16     ~15, 'name'
          8        BOOL_NOT                                         ~17     ~16
          9      > JMPNZ_EX                                         ~17     ~17, ->14
   39    10    >   FETCH_IS                                         ~18     '_POST'
         11        ISSET_ISEMPTY_DIM_OBJ                         0  ~19     ~18, 'bname'
         12        BOOL_NOT                                         ~20     ~19
         13        BOOL                                             ~17     ~20
         14    > > JMPNZ_EX                                         ~17     ~17, ->19
   41    15    >   FETCH_IS                                         ~21     '_POST'
         16        ISSET_ISEMPTY_DIM_OBJ                         0  ~22     ~21, 'tel'
         17        BOOL_NOT                                         ~23     ~22
         18        BOOL                                             ~17     ~23
         19    > > JMPNZ_EX                                         ~17     ~17, ->24
   43    20    >   FETCH_IS                                         ~24     '_POST'
         21        ISSET_ISEMPTY_DIM_OBJ                         0  ~25     ~24, 'email'
         22        BOOL_NOT                                         ~26     ~25
         23        BOOL                                             ~17     ~26
         24    > > JMPNZ_EX                                         ~17     ~17, ->29
   45    25    >   FETCH_IS                                         ~27     '_POST'
         26        ISSET_ISEMPTY_DIM_OBJ                         0  ~28     ~27, 'textarea'
         27        BOOL_NOT                                         ~29     ~28
         28        BOOL                                             ~17     ~29
         29    > > JMPZ                                                     ~17, ->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              ~31     '_POST'
         34        FETCH_DIM_R                                      ~32     ~31, 'name'
         35        ASSIGN                                                   !2, ~32
   55    36        FETCH_R                      global              ~34     '_POST'
         37        FETCH_DIM_R                                      ~35     ~34, 'bname'
         38        ASSIGN                                                   !3, ~35
   57    39        FETCH_R                      global              ~37     '_POST'
         40        FETCH_DIM_R                                      ~38     ~37, 'tel'
         41        ASSIGN                                                   !4, ~38
   59    42        FETCH_R                      global              ~40     '_POST'
         43        FETCH_DIM_R                                      ~41     ~40, 'email'
         44        ASSIGN                                                   !5, ~41
   61    45        FETCH_R                      global              ~43     '_POST'
         46        FETCH_DIM_R                                      ~44     ~43, 'textarea'
         47        ASSIGN                                                   !6, ~44
   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                                         $48     
         54        BOOL_NOT                                         ~49     $48
         55      > JMPZ                                                     ~49, ->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                                         $52     
         62        BOOL_NOT                                         ~53     $52
         63      > JMPZ                                                     ~53, ->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                                         $55     
         69        BOOL_NOT                                         ~56     $55
         70      > JMPZ                                                     ~56, ->72
   87    71    >   ASSIGN_OP                                     8          !7, 'Vul+uw+Bedrijfsnaam+in.%3Cbr+%2F%3E'
   91    72    >   STRLEN                                           ~58     !6
         73        IS_SMALLER                                               ~58, 2
         74      > JMPZ                                                     ~59, ->76
   93    75    >   ASSIGN_OP                                     8          !7, 'The+Comments+you+entered+do+not+appear+to+be+valid.%3Cbr+%2F%3E'
   97    76    >   STRLEN                                           ~61     !7
         77        IS_SMALLER                                               0, ~61
         78      > JMPZ                                                     ~62, ->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  $64     
         86        CONCAT                                           ~65     'Naam%3A+', $64
         87        CONCAT                                           ~66     ~65, '%0A'
         88        ASSIGN_OP                                     8          !10, ~66
  116    89        INIT_FCALL_BY_NAME                                       'clean_string'
         90        SEND_VAR_EX                                              !3
         91        DO_FCALL                                      0  $68     
         92        CONCAT                                           ~69     'Bedrijf%3A+', $68
         93        CONCAT                                           ~70     ~69, '%0A'
         94        ASSIGN_OP                                     8          !10, ~70
  118    95        INIT_FCALL_BY_NAME                                       'clean_string'
         96        SEND_VAR_EX                                              !4
         97        DO_FCALL                                      0  $72     
         98        CONCAT                                           ~73     'Telefoon%3A+', $72
         99        CONCAT                                           ~74     ~73, '%0A'
        100        ASSIGN_OP                                     8          !10, ~74
  120   101        INIT_FCALL_BY_NAME                                       'clean_string'
        102        SEND_VAR_EX                                              !5
        103        DO_FCALL                                      0  $76     
        104        CONCAT                                           ~77     'Email%3A+', $76
        105        CONCAT                                           ~78     ~77, '%0A'
        106        ASSIGN_OP                                     8          !10, ~78
  122   107        INIT_FCALL_BY_NAME                                       'clean_string'
        108        SEND_VAR_EX                                              !6
        109        DO_FCALL                                      0  $80     
        110        CONCAT                                           ~81     'Vraag%3A+', $80
        111        CONCAT                                           ~82     ~81, '%0A'
        112        ASSIGN_OP                                     8          !10, ~82
  133   113        BEGIN_SILENCE                                    ~84     
        114        INIT_FCALL                                               'mail'
        115        SEND_VAR                                                 !0
        116        SEND_VAR                                                 !1
        117        SEND_VAR                                                 !10
        118        DO_ICALL                                                 
        119        END_SILENCE                                              ~84
  134   120        INIT_FCALL                                               'header'
        121        SEND_VAL                                                 'Location%3Abedankt.html'
        122        DO_ICALL                                                 
  135   123      > EXIT                                                     
  137   124*       ECHO                                                     '+%0A+%0A+%0A%3C%21--+include+your+own+success+html+here+--%3E%0A%0A%0A%0A%0A+%0A'
  150   125    > > RETURN                                                   1

Function %00died%2Fin%2FIpKDs%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/IpKDs
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%2FIpKDs%3A17%240

Function %00clean_string%2Fin%2FIpKDs%3A104%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IpKDs
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%2FIpKDs%3A104%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.67 ms | 1408 KiB | 21 Q