/    Sign up×
Community /Pin to ProfileBookmark

Get 500 error when submit form

Hi,

I have a form on this page – [url]http://www.organicspirit.co.uk/contact.php[/url] using the script called “send_contact.php” when submitted.

It used to work but now when you hit submit, you get following message –
[I]500 – Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.[/I]

Do I need to understand that the issue lies with the hosting provider or is there something wrong with my script (which I pasted below)

send_contact.php —————————————

<?php
// Contact subject
$subject = $_POST[‘subject’];
// Details
$message = $_
POST[‘detail’];
// Mail of sender
$mail_from = $_POST[‘customer_mail’];
// From
$header = “from: $name <$mail_from>”;
// Enter your email address
$to = ‘[email protected]‘;
$send_contact = mail($to,$subject,$message,$header);
// Check, if message sent to your email

header (‘Location: [url]http://www.organicspirit.co.uk/thank-you.html’);[/url]
exit ();

if($send_contact){
echo “We’ve received your contact information”;
}
else {
echo “ERROR”;
}
?>

Thank you for your help!

P

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Pierrick spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...