3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "galaxytrackercontact@yahoo.com"; $email_subject = "Galaxy Tracker Help"; function died($error) { // your error code can go here echo "<strong>Προέκυψε ένα ή περισσότερα σφάλματα κατα την αποστολή του μηνύματος σας!<br></strong>"; echo $error."<br/>"; echo "<strong>Παρακαλούμε διορθώστε τα και δοκιμάστε ξανά.<br /><br /></strong>"; die(); } // validation expected data exists if( !isset($_POST['email']) || !isset($_POST['telephone']) || !isset($_POST['comments'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // not required $comments = $_POST['comments']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'Παρακαλούμε συμπληρώστε σωστά το email σας.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(strlen($comments) < 2) { $error_message .= 'Ξέχασες να μας γράψεις το πρόβλημα που αντιμετωπίζεις.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = ""; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Username: ".clean_string($telephone)."\n"; $email_message .= "Πρόβλημα: ".clean_string($comments)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <!-- include your own success html here --> Επιτυχία αποστολής!<br> <br> Ευχαριστούμε που επικοινωνήσατε μαζί μας.<br> Ένα μέλος της ομάδας μας έχει αναλάβει το μήνυμα σας!<br> Θα σας απαντήσουμε το συντομότερο δυνατό<br> <?php } ?>

preferences:
50.48 ms | 402 KiB | 5 Q