3v4l.org

run code in 300+ PHP versions simultaneously
<? /* 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 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 7.1.26 - 7.1.33, 7.2.17 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<? /* 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 8.0.13
Warning: Undefined array key "name" in /in/FNhu1 on line 10 Warning: Undefined array key "email" in /in/FNhu1 on line 11 Warning: Undefined array key "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 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.6, 7.4.33
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 7.3.32 - 7.3.33
<strong>Error:</strong> Please provide your name.<br/><br/><a href='javascript:history.go(-1)'>Back</a>

preferences:
274 ms | 401 KiB | 384 Q