Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Contact Form Error (https://www.warriorforum.com/programming/211406-contact-form-error.html)

Social Experts 11th May 2010 06:24 AM

Contact Form Error
 
I am making a new site and I have good knowledge in HTML but PHP is where I'm not too good. This is my site:

Official Review - Contact

See when you try send, it comes up with an error

This is the form.php file:

Quote:

<?php

$goto_after_mail = "thanks.html"; // this is the page which is shown after the mail is submitted
$from_mail = $_REQUEST['Email'];
$from_name = $_REQUEST['Name']; // use both value's from your form
$header = "From: \"$from_name\" <$from_mail>\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-Type: text/plain; charset=\"utf-8\"\r\n";
$header .= "Content-Transfer-Encoding: 7bit\r\n";
$subject = "Website Form Submission".date("d-m-Y"); //your mailsubject incl. current date
foreach ($_REQUEST as $key => $val) {
if ($key != "from_email" && $key != "from_name") { //skip, this values are already in the header
$body .= $key . " : " . $val . "\r\n";
}
}
if (mail("matt@official-review.org", $subject, $body, $header)) {
header("Location: ".$goto_after_mail);
}
?>
Anyone have an idea?

Social Experts 11th May 2010 06:08 PM

Re: Contact Form Error
 
Anyone? Pleaseeeeeeee

Manfred Ekblad 11th May 2010 06:46 PM

Re: Contact Form Error
 
Just tried it, I'm getting a "500 Internal server error". You need to check the error logs of your webserver, most likely there will be some more information about the error.

You could also try this:

Replace the current code in form.php with...


<?php

var_dump($GLOBALS);

?>


If you still get the error, it's not your code, it's the server configuration.

Btw, I noticed that you are not doing any input validation...

Social Experts 11th May 2010 07:30 PM

Re: Contact Form Error
 
Ok I changed the code to that and now I get this:

Quote:

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@official-review.perfectballhandling.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Is it my server? What should I do?

Manfred Ekblad 11th May 2010 07:41 PM

Re: Contact Form Error
 
If it's not your server configuration then it might be something about your karma. Search within... and check the error logs of the server as well.

Will this script run?

<?php

phpinfo();

?>

Social Experts 11th May 2010 08:33 PM

Re: Contact Form Error
 
This is what is in my error logs:

Quote:

[07-May-2010 22:09:03] PHP Warning: chmod() [<a href='function.chmod'>function.chmod</a>]: No such file or directory in /home/thefresh/public_html/official-review.org/prepare_removal.php on line 110

Manfred Ekblad 11th May 2010 09:37 PM

Re: Contact Form Error
 
That's it? There should be errors from today, since we had a couple of them already.

Social Experts 11th May 2010 11:51 PM

Re: Contact Form Error
 
Yeah that's all I got. I just wanna get it fixed lol

Manfred Ekblad 12th May 2010 02:19 AM

Re: Contact Form Error
 
could be a corrupt .htaccess-file... u host it urself (dedicated/vps) or u have a "normal" web hosting account?

Social Experts 13th May 2010 02:29 AM

Re: Contact Form Error
 
I'm with hostgator. I just wanna get this sorted


All times are GMT -6. The time now is 08:23 AM.