3v4l.org

run code in 300+ PHP versions simultaneously
<?php if ( !isset( $_SESSION ) ) session_start(); if ( !$_POST ) exit; if ( !defined( "PHP_EOL" ) ) define( "PHP_EOL", "\r\n" ); /////////////////////////////////////////////////////////////////////////// // Simple Configuration Options // Enter the email address that you want to emails to be sent to. // Example $address = "joe.doe@yourdomain.com"; $address = "webmaster@tobaccoworld.de"; // END OF Simple Configuration Options /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // // Do not edit the following lines // /////////////////////////////////////////////////////////////////////////// $postValues = array(); foreach ( $_POST as $name => $value ) { $postValues[$name] = trim( $value ); } extract( $postValues ); // Important Variables $posted_verify = isset( $postValues['verify'] ) ? md5( $postValues['verify'] ) : ''; $session_verify = !empty($_SESSION['yoarts']['ajax-extended-form']['verify']) ? $_SESSION['yoarts']['ajax-extended-form']['verify'] : ''; $error = ''; /////////////////////////////////////////////////////////////////////////// // // Begin verification process // // You may add or edit lines in here. // // To make a field not required, simply delete the entire if statement for that field. // /////////////////////////////////////////////////////////////////////////// //////////////////////// // Subject field is required if ( empty( $subject ) ) { $error .= 'Your subject is required.'; } //////////////////////// //////////////////////// // Name field is required if ( empty( $name ) ) { $error .= 'Your name is required.'; } //////////////////////// //////////////////////// // Email field is required if ( empty( $email ) ) { $error .= 'Your e-mail address is required.'; } elseif ( !isEmail( $email ) ) { $error .= 'You have entered an invalid e-mail address.'; } //////////////////////// //////////////////////// // Comments field is required if ( empty( $message ) ) { $error .= 'You must enter a message to send.'; } //////////////////////// //////////////////////// // Verification code is required if ( $session_verify != $posted_verify ) { $error .= 'The verification code you entered is incorrect.'; } //////////////////////// if ( !empty($error) ) { echo '<div class="alert alert-danger">Oh snap! ' . $error . '</div>'; // Important to have return false in here. return false; } // Advanced Configuration Option. // i.e. The standard subject will appear as, "You've been contacted by John Doe." $e_subject = "Batman, wir haben eine neue Nachricht von: " . $name; // Advanced Configuration Option. // You can change this if you feel that you need to. // Developers, you may wish to add more fields to the form, in which case you must be sure to add them here. $msg = "Es gibt eine Nachricht von $name zum Thema $subject. Die Nachricht ist folgende:" . PHP_EOL . PHP_EOL; $msg .= $message . PHP_EOL . PHP_EOL; $msg .= "Wir können $name unter folgender E-Mail-Adresse antworten: $email." . PHP_EOL . PHP_EOL; $msg .= "-------------------------------------------------------------------------------------------" . PHP_EOL; $msg .= "Diese Nachricht wurde uns über das Kontaktformular der Website geschickt."; $msg = wordwrap( $msg, 70 ); $headers = "From: $email" . PHP_EOL; $headers .= "Reply-To: $email" . PHP_EOL; $headers .= "MIME-Version: 1.0" . PHP_EOL; $headers .= "Content-type: text/plain; charset=utf-8" . PHP_EOL; $headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL; if ( mail( $address, $e_subject, $msg, $headers ) ) { echo "<div class='alert alert-success'>Well done! Your message has been submitted to us.</div>"; // Important to have return false in here. return false; } /////////////////////////////////////////////////////////////////////////// // // Do not edit below this line // /////////////////////////////////////////////////////////////////////////// echo '<div class="alert alert-danger">Error! Please confirm PHP mail() is enabled.</div>'; return false; function isEmail( $email ) { // Email address verification, do not edit. return preg_match( "/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i", $email ); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 26
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 26
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 52
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 58
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 61
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 65
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 74
Branch analysis from position: 73
2 jumps found. (Code = 43) Position 1 = 76, Position 2 = 77
Branch analysis from position: 76
2 jumps found. (Code = 43) Position 1 = 80, Position 2 = 84
Branch analysis from position: 80
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 84
2 jumps found. (Code = 43) Position 1 = 130, Position 2 = 132
Branch analysis from position: 130
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 132
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 77
Branch analysis from position: 74
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 71
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 74
Branch analysis from position: 73
Branch analysis from position: 74
Branch analysis from position: 71
Branch analysis from position: 61
Branch analysis from position: 58
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 58
Branch analysis from position: 57
Branch analysis from position: 58
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 52
Branch analysis from position: 46
Branch analysis from position: 52
Branch analysis from position: 26
Branch analysis from position: 14
Branch analysis from position: 5
filename:       /in/q2bdo
function name:  (null)
number of ops:  135
compiled vars:  !0 = $address, !1 = $postValues, !2 = $value, !3 = $name, !4 = $posted_verify, !5 = $session_verify, !6 = $error, !7 = $subject, !8 = $email, !9 = $message, !10 = $e_subject, !11 = $msg, !12 = $headers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ISSET_ISEMPTY_VAR                             2  ~13     '_SESSION'
          1        BOOL_NOT                                         ~14     ~13
          2      > JMPZ                                                     ~14, ->5
          3    >   INIT_FCALL                                               'session_start'
          4        DO_ICALL                                                 
    3     5    >   FETCH_R                      global              ~16     '_POST'
          6        BOOL_NOT                                         ~17     ~16
          7      > JMPZ                                                     ~17, ->9
          8    > > EXIT                                                     
    5     9    > > JMPZ                                                     <false>, ->14
         10    >   INIT_FCALL                                               'define'
         11        SEND_VAL                                                 'PHP_EOL'
         12        SEND_VAL                                                 '%0D%0A'
         13        DO_ICALL                                                 
   14    14    >   ASSIGN                                                   !0, 'webmaster%40tobaccoworld.de'
   26    15        ASSIGN                                                   !1, <array>
   27    16        FETCH_R                      global              ~21     '_POST'
         17      > FE_RESET_R                                       $22     ~21, ->26
         18    > > FE_FETCH_R                                       ~23     $22, !2, ->26
         19    >   ASSIGN                                                   !3, ~23
   28    20        INIT_FCALL                                               'trim'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $26     
         23        ASSIGN_DIM                                               !1, !3
         24        OP_DATA                                                  $26
   27    25      > JMP                                                      ->18
         26    >   FE_FREE                                                  $22
   30    27        INIT_FCALL                                               'extract'
         28        SEND_REF                                                 !1
         29        DO_ICALL                                                 
   34    30        ISSET_ISEMPTY_DIM_OBJ                         0          !1, 'verify'
         31      > JMPZ                                                     ~28, ->38
         32    >   INIT_FCALL                                               'md5'
         33        FETCH_DIM_R                                      ~29     !1, 'verify'
         34        SEND_VAL                                                 ~29
         35        DO_ICALL                                         $30     
         36        QM_ASSIGN                                        ~31     $30
         37      > JMP                                                      ->39
         38    >   QM_ASSIGN                                        ~31     ''
         39    >   ASSIGN                                                   !4, ~31
   35    40        FETCH_IS                                         ~33     '_SESSION'
         41        FETCH_DIM_IS                                     ~34     ~33, 'yoarts'
         42        FETCH_DIM_IS                                     ~35     ~34, 'ajax-extended-form'
         43        ISSET_ISEMPTY_DIM_OBJ                         1  ~36     ~35, 'verify'
         44        BOOL_NOT                                         ~37     ~36
         45      > JMPZ                                                     ~37, ->52
         46    >   FETCH_R                      global              ~38     '_SESSION'
         47        FETCH_DIM_R                                      ~39     ~38, 'yoarts'
         48        FETCH_DIM_R                                      ~40     ~39, 'ajax-extended-form'
         49        FETCH_DIM_R                                      ~41     ~40, 'verify'
         50        QM_ASSIGN                                        ~42     ~41
         51      > JMP                                                      ->53
         52    >   QM_ASSIGN                                        ~42     ''
         53    >   ASSIGN                                                   !5, ~42
   37    54        ASSIGN                                                   !6, ''
   52    55        ISSET_ISEMPTY_CV                                         !7
         56      > JMPZ                                                     ~45, ->58
   53    57    >   ASSIGN_OP                                     8          !6, 'Your+subject+is+required.'
   60    58    >   ISSET_ISEMPTY_CV                                         !3
         59      > JMPZ                                                     ~47, ->61
   61    60    >   ASSIGN_OP                                     8          !6, 'Your+name+is+required.'
   68    61    >   ISSET_ISEMPTY_CV                                         !8
         62      > JMPZ                                                     ~49, ->65
   69    63    >   ASSIGN_OP                                     8          !6, 'Your+e-mail+address+is+required.'
         64      > JMP                                                      ->71
   70    65    >   INIT_FCALL_BY_NAME                                       'isEmail'
         66        SEND_VAR_EX                                              !8
         67        DO_FCALL                                      0  $51     
         68        BOOL_NOT                                         ~52     $51
         69      > JMPZ                                                     ~52, ->71
   71    70    >   ASSIGN_OP                                     8          !6, 'You+have+entered+an+invalid+e-mail+address.'
   78    71    >   ISSET_ISEMPTY_CV                                         !9
         72      > JMPZ                                                     ~54, ->74
   79    73    >   ASSIGN_OP                                     8          !6, 'You+must+enter+a+message+to+send.'
   86    74    >   IS_NOT_EQUAL                                             !5, !4
         75      > JMPZ                                                     ~56, ->77
   87    76    >   ASSIGN_OP                                     8          !6, 'The+verification+code+you+entered+is+incorrect.'
   91    77    >   ISSET_ISEMPTY_CV                                 ~58     !6
         78        BOOL_NOT                                         ~59     ~58
         79      > JMPZ                                                     ~59, ->84
   92    80    >   CONCAT                                           ~60     '%3Cdiv+class%3D%22alert+alert-danger%22%3EOh+snap%21+', !6
         81        CONCAT                                           ~61     ~60, '%3C%2Fdiv%3E'
         82        ECHO                                                     ~61
   95    83      > RETURN                                                   <false>
  102    84    >   CONCAT                                           ~62     'Batman%2C+wir+haben+eine+neue+Nachricht+von%3A+', !3
         85        ASSIGN                                                   !10, ~62
  108    86        ROPE_INIT                                     5  ~65     'Es+gibt+eine+Nachricht+von+'
         87        ROPE_ADD                                      1  ~65     ~65, !3
         88        ROPE_ADD                                      2  ~65     ~65, '+zum+Thema+'
         89        ROPE_ADD                                      3  ~65     ~65, !7
         90        ROPE_END                                      4  ~64     ~65, '.+Die+Nachricht+ist+folgende%3A'
         91        CONCAT                                           ~68     ~64, '%0A'
         92        CONCAT                                           ~69     ~68, '%0A'
         93        ASSIGN                                                   !11, ~69
  109    94        CONCAT                                           ~71     !9, '%0A'
         95        CONCAT                                           ~72     ~71, '%0A'
         96        ASSIGN_OP                                     8          !11, ~72
  110    97        ROPE_INIT                                     5  ~75     'Wir+k%C3%B6nnen+'
         98        ROPE_ADD                                      1  ~75     ~75, !3
         99        ROPE_ADD                                      2  ~75     ~75, '+unter+folgender+E-Mail-Adresse+antworten%3A+'
        100        ROPE_ADD                                      3  ~75     ~75, !8
        101        ROPE_END                                      4  ~74     ~75, '.'
        102        CONCAT                                           ~78     ~74, '%0A'
        103        CONCAT                                           ~79     ~78, '%0A'
        104        ASSIGN_OP                                     8          !11, ~79
  111   105        ASSIGN_OP                                     8          !11, '-------------------------------------------------------------------------------------------%0A'
  112   106        ASSIGN_OP                                     8          !11, 'Diese+Nachricht+wurde+uns+%C3%BCber+das+Kontaktformular+der+Website+geschickt.'
  113   107        INIT_FCALL                                               'wordwrap'
        108        SEND_VAR                                                 !11
        109        SEND_VAL                                                 70
        110        DO_ICALL                                         $83     
        111        ASSIGN                                                   !11, $83
  115   112        NOP                                                      
        113        FAST_CONCAT                                      ~85     'From%3A+', !8
        114        CONCAT                                           ~86     ~85, '%0A'
        115        ASSIGN                                                   !12, ~86
  116   116        NOP                                                      
        117        FAST_CONCAT                                      ~88     'Reply-To%3A+', !8
        118        CONCAT                                           ~89     ~88, '%0A'
        119        ASSIGN_OP                                     8          !12, ~89
  117   120        ASSIGN_OP                                     8          !12, 'MIME-Version%3A+1.0%0A'
  118   121        ASSIGN_OP                                     8          !12, 'Content-type%3A+text%2Fplain%3B+charset%3Dutf-8%0A'
  119   122        ASSIGN_OP                                     8          !12, 'Content-Transfer-Encoding%3A+quoted-printable%0A'
  121   123        INIT_FCALL                                               'mail'
        124        SEND_VAR                                                 !0
        125        SEND_VAR                                                 !10
        126        SEND_VAR                                                 !11
        127        SEND_VAR                                                 !12
        128        DO_ICALL                                         $94     
        129      > JMPZ                                                     $94, ->132
  123   130    >   ECHO                                                     '%3Cdiv+class%3D%27alert+alert-success%27%3EWell+done%21+Your+message+has+been+submitted+to+us.%3C%2Fdiv%3E'
  126   131      > RETURN                                                   <false>
  136   132    >   ECHO                                                     '%3Cdiv+class%3D%22alert+alert-danger%22%3EError%21+Please+confirm+PHP+mail%28%29+is+enabled.%3C%2Fdiv%3E'
  137   133      > RETURN                                                   <false>
  144   134*     > RETURN                                                   1

Function isemail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q2bdo
function name:  isEmail
number of ops:  7
compiled vars:  !0 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  139     0  E >   RECV                                             !0      
  141     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%5B-_.%5B%3Aalnum%3A%5D%5D%2B%40%28%28%28%5B%5B%3Aalnum%3A%5D%5D%7C%5B%5B%3Aalnum%3A%5D%5D%5B%5B%3Aalnum%3A%5D-%5D%2A%5B%5B%3Aalnum%3A%5D%5D%29%5C.%29%2B%28ad%7Cae%7Caero%7Caf%7Cag%7Cai%7Cal%7Cam%7Can%7Cao%7Caq%7Car%7Carpa%7Cas%7Cat%7Cau%7Caw%7Caz%7Cba%7Cbb%7Cbd%7Cbe%7Cbf%7Cbg%7Cbh%7Cbi%7Cbiz%7Cbj%7Cbm%7Cbn%7Cbo%7Cbr%7Cbs%7Cbt%7Cbv%7Cbw%7Cby%7Cbz%7Cca%7Ccc%7Ccd%7Ccf%7Ccg%7Cch%7Cci%7Cck%7Ccl%7Ccm%7Ccn%7Cco%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7Ctr%7Ctt%7Ctv%7Ctw%7Ctz%7Cua%7Cug%7Cuk%7Cum%7Cus%7Cuy%7Cuz%7Cva%7Cvc%7Cve%7Cvg%7Cvi%7Cvn%7Cvu%7Cwf%7Cws%7Cye%7Cyt%7Cyu%7Cza%7Czm%7Czw%29%24%7C%28%28%5B0-9%5D%5B0-9%5D%3F%7C%5B0-1%5D%5B0-9%5D%5B0-9%5D%7C%5B2%5D%5B0-4%5D%5B0-9%5D%7C%5B2%5D%5B5%5D%5B0-5%5D%29%5C.%29%7B3%7D%28%5B0-9%5D%5B0-9%5D%3F%7C%5B0-1%5D%5B0-9%5D%5B0-9%5D%7C%5B2%5D%5B0-4%5D%5B0-9%5D%7C%5B2%5D%5B5%5D%5B0-5%5D%29%29%24%2Fi'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
  143     6*     > RETURN                                                   null

End of function isemail

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.35 ms | 1412 KiB | 29 Q