Dear all,
I have to admit I am not a pro developer, usually more project manager/tester. But I think what I try to achieve is FAIRLY easy, I just don’t understand what is happening with Webflow!
If you go to https://www.miu-massage.me/#Booking there is a contact form! As “Action” I set “https://www.miu-massage.me/mail.php”:
My mail.php looks like this, pretty straight forward (I got the code from here and adjusted it):
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST'){
if (isset($_POST['Full-Name'])) $sender_name = preg_replace("([\r\n])", "", $_POST['Full-Name']);
if (isset($_POST['Email'])) $sender_email = preg_replace("([\r\n])", "", $_POST['Email']);
if (isset($_POST['Phone'])) $sender_phone = preg_replace("([\r\n])", "", $_POST['Phone']);
if (isset($_POST['Date'])) $sender_message = preg_replace("([\r\n])", "", $_POST['Date']);
$formcontent="From: $sender_name \n Email: $sender_email \n Line ID/Phone number/Whatsapp: $sender_phone \n Massage Type: $_POST['Massage-Type'] \n Desired Date and Time: $sender_message";
$recipient = "xyz"; // Removed my email
$subject = "New Booking Request via Website!";
$match = "/(bcc:|cc:|content\-type:)/i";
if (preg_match($match, $sender_name) ||
preg_match($match, $sender_email) ||
preg_match($match, $sender_phone) ||
preg_match($match, $sender_message)) {
die("Header injection detected.");
}
$mailheader = "From: $sender_email \r\n";
$mailheader .= "Reply-to: $sender_email\r\n";
mail($recipient, $subject, $formcontent, $mailheader);
header('Location: success.html');
exit;
} else {
die("Direct access not allowed!");
}
?>
After that I exported the site and uploaded it via FTP to my server. So the index.html and mail.php are LITERALLY lying next to each other on the same server + folder:
Now when I submit the form via https://www.miu-massage.me/#Booking I get an “Error 500” and I can see in the Chrome dev tools something about Referrer Policy: strict-origin-when-cross-origin:
Data submitted by the form seems ok!?
Now I don’t understand this:
- Why is there even ANYTHING mentioned about miu-massage.webflow.io? I even unpublished the Staging site! It does not exist anymore! I exported all files and uploaded them to my own server. It should not have to do ANYTHING with miu-massage.webflow.io!?
- How to fix this? I don’t even get that far so see any details whether the PHP file is working or not.
Thank you so much everyone who can help me with that.
READ ONLY LINK: Webflow - Miu Massage