I just implemented a php contact form, but its throwing a HTTP ERROR 500 when I fill out the form and hit the submit button.
Im using the following html markup and php code. Theres no ini.php in the root folder, which I found as most answers on my problem.
<form action="php/mail.php" method="post" enctype="multipart/form-data">
<input name="sender_name" placeholder="Your Name..."/>
<input name="sender_email" placeholder="Your email..."/>
<textarea placeholder="Your Message..." name="sender_message"></textarea>
<div class="captcha_wrapper">
<div class="g-recaptcha" data-sitekey="placeholder"></div>
</div>
<button type="submit" id="send_message">Send Message!</button>
<form>
<?php
$sender_name=stripslashes($_POST["fullname"]);
$sender_email=stripslashes($_POST["email"]);
$sender_message=stripslashes($_POST["message"]);
$secret="6LdFvi0UAAAAAD21HxZ1KkptlAIq06K12d8sTMWn";
$response=$_POST["g-recaptcha-response"];
$verify=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secret}&response={$response}");
$captcha_success=json_decode($verify);
$subject="Important Message".$_POST['subject'];
$headers= "From: ".$_POST['email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$headers1="From: "."hello@placeholder.com"."\n";
$headers1.='Content-type: text/html; charset=iso-8859-1';
$success = mail("hello@placeholder.com", $subject,"Important Message You’ve received a message from YOUR website.
Message: “.$_POST[‘message’].”
Please Contact: “.$_POST[‘fullname’].”
Phone: “.$_POST[‘phone’].”
Email: “.$_POST[’email’].” ” , $headers);@mail($_POST[’email’],’YOUR-NAME’,$body1,$headers1);
if ($captcha_success->success==false) {
echo “You are a bot! Go away!”;
} else if ($captcha_success->success==true) {
print “”;
}
?>
You can test it at: http://atelier-rauen.de/test/contact
Is it a problem with permissions on the server? The php folder has 0755 and the php file 0644.
Thank you for your help!