3v4l.org

run code in 300+ PHP versions simultaneously
<?php // get all form values $input['Contact name'] = $_POST['contact_name'] ?? ''; $input['Firm name'] = $_POST['firm_name'] ?? ''; $input['Email'] = $_POST['email'] ?? ''; $input['Job number'] = $_POST['job_number'] ?? ''; $input['Document'] = $_POST['document'] ?? ''; $input['Discount'] = $_POST['discount'] ?? ''; $input['Message'] = $_POST['message'] ?? ''; // generate the email content (i.e. each line is like "Contact name: Mark") $formContent = ''; foreach($input as $key => $value) { $formContent .= $key . ": " . $value . "\n"; } $to = "my@email.com"; // TODO: replace this with your email address $subject = "Contact Form"; /* Note that this is likely part of the issue. Most email clients (gmail, outlook) will mark emails as spam if you try to send an email from an email address that your server isn't configured to send from. See https://stackoverflow.com/questions/17533863/how-to-configure-php-to-send-e-mail for more info. */ $mailheader = "From: " . $input['Email']; // for this example, output $formContent and end the script because mail() isn't allowed here var_dump($formContent); die(); mail($to, $subject, $formContent, $mailheader) or die('Error sending email'); // redirect to the thank you page // TODO: update this URL to be yours header('Location: http://www.example.com/thankyou.html'); exit;
Output for git.master, git.master_jit, rfc.property-hooks
string(80) "Contact name: Firm name: Email: Job number: Document: Discount: Message: "

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
83.83 ms | 405 KiB | 5 Q