I have been struggling with running a php file for an html form I have on a website.
I built a similar php file for another website, and it works great, but for some reason this one is just not working. I get:
This page isn’t working
mywebsite.com is currently unable to handle this request.
HTTP ERROR 500
I know this is something simple, I’m just at a dead end right now.
<?php $nameFirst = $_POST['nameFirst']; $nameLast = $_POST['nameLast']; $email = $_POST['email']; $website = $_POST['website']; //$service = $_POST['service']; $message = $_POST['message']; $formcontent = "Sender name: $nameFirst $nameLast\n Email: $email \n Website: $website \n Message: $message"; $recipient = "firstname.lastname@example.org"; $subject = "Web submission from $email"; $mailheader = "For My Company \r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Error!"); ?> <html> <head> <title>Contact ZS | Thank You</title> <link href="css_zs_master.css" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="https://use.typekit.net/emu2xge.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <div class="container"> <h5 class="form-data">Thank You <? php echo "$nameFirst"; ?>!</h5> <h6 class="form-data">Your request has been sent and you will receive a follow up email shortly.</h6> <a href="index-home.html"><button class="plain-button"><i class="fa fa-home"></i></i> Home</button></a> </div> </body> </html>