3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? /* Edit these preferences to suit your needs */ $mailto = "busernya@hotmail.com"; // insert the email address you want the form sent to $returnpage = 'thankyou.html'; // insert the name of the page/location you want the user to be returned to $sitename = '[www.busernya.com]'; // insert the site name here, it will appear in the subject of your email /* Do not edit below this line unless you know what you're doing */ $name = $_POST['name']; $email = $_POST['email'] ; $enquiry = stripslashes($_POST['query']); if (!$name) { print("<strong>Error:</strong> Please provide your name.<br/><br/><a href='javascript:history.go(-1)'>Back</a>"); exit; } if (!$email) { print("<strong>Error:</strong> Please provide an email address.<br/><br/><a href='javascript:history.go(-1)'>Back</a>"); exit; } if (!$enquiry) { print("<strong>Error:</strong> Please provide your enquiry details.<br/><br/><a href='javascript:history.go(-1)'>Back</a>"); exit; } if (!eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email)){ print("<strong>Error:</strong> this email address is not in a valid format.<br/><br/><a href='javascript:history.go(-1)'>Back</a>"); exit; } $message = "\n$name submitted the following message:\n\n$enquiry\n\nTheir contact details are as follows:\n\nName: $name\nEmail Address: $email\n\n"; mail($mailto, "$sitename Contact Form Enquiry from $name", $message, "From: $email"); header("Location: " . $returnpage); ?>
Output for 5.4.0 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
Notice: Undefined index: name in /in/FNhu1 on line 10 Notice: Undefined index: email in /in/FNhu1 on line 11 Notice: Undefined index: query in /in/FNhu1 on line 12 <strong>Error:</strong> Please provide your name.<br/><br/><a href='javascript:history.go(-1)'>Back</a>
Output for hhvm-3.12.0
Notice: Undefined index: name in /in/FNhu1 on line 10 Notice: Undefined index: email in /in/FNhu1 on line 11 Notice: Undefined index: query in /in/FNhu1 on line 12 Warning: stripslashes() expects parameter 1 to be string, null given in /in/FNhu1 on line 12 <strong>Error:</strong> Please provide your name.<br/><br/><a href='javascript:history.go(-1)'>Back</a>
Output for 4.3.0 - 5.3.29
<? /* Edit these preferences to suit your needs */ $mailto = "busernya@hotmail.com"; // insert the email address you want the form sent to $returnpage = 'thankyou.html'; // insert the name of the page/location you want the user to be returned to $sitename = '[www.busernya.com]'; // insert the site name here, it will appear in the subject of your email /* Do not edit below this line unless you know what you're doing */ $name = $_POST['name']; $email = $_POST['email'] ; $enquiry = stripslashes($_POST['query']); if (!$name) { print("<strong>Error:</strong> Please provide your name.<br/><br/><a href='javascript:history.go(-1)'>Back</a>"); exit; } if (!$email) { print("<strong>Error:</strong> Please provide an email address.<br/><br/><a href='javascript:history.go(-1)'>Back</a>"); exit; } if (!$enquiry) { print("<strong>Error:</strong> Please provide your enquiry details.<br/><br/><a href='javascript:history.go(-1)'>Back</a>"); exit; } if (!eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}", $email)){ print("<strong>Error:</strong> this email address is not in a valid format.<br/><br/><a href='javascript:history.go(-1)'>Back</a>"); exit; } $message = "\n$name submitted the following message:\n\n$enquiry\n\nTheir contact details are as follows:\n\nName: $name\nEmail Address: $email\n\n"; mail($mailto, "$sitename Contact Form Enquiry from $name", $message, "From: $email"); header("Location: " . $returnpage); ?>