9 replies
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:

<?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?
#contact #error #form
  • Profile picture of the author Social Experts
    Anyone? Pleaseeeeeeee
    Signature

    Chill.

    {{ DiscussionBoard.errors[2087840].message }}
  • Profile picture of the author Manfred Ekblad
    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...
    {{ DiscussionBoard.errors[2087964].message }}
  • Profile picture of the author Social Experts
    Ok I changed the code to that and now I get this:

    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?
    Signature

    Chill.

    {{ DiscussionBoard.errors[2088081].message }}
  • Profile picture of the author Manfred Ekblad
    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();

    ?>
    {{ DiscussionBoard.errors[2088119].message }}
  • Profile picture of the author Social Experts
    This is what is in my error logs:

    [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
    Signature

    Chill.

    {{ DiscussionBoard.errors[2088305].message }}
  • Profile picture of the author Manfred Ekblad
    That's it? There should be errors from today, since we had a couple of them already.
    {{ DiscussionBoard.errors[2088547].message }}
  • Profile picture of the author Social Experts
    Yeah that's all I got. I just wanna get it fixed lol
    Signature

    Chill.

    {{ DiscussionBoard.errors[2088898].message }}
  • Profile picture of the author Manfred Ekblad
    could be a corrupt .htaccess-file... u host it urself (dedicated/vps) or u have a "normal" web hosting account?
    {{ DiscussionBoard.errors[2089264].message }}
  • Profile picture of the author Social Experts
    I'm with hostgator. I just wanna get this sorted
    Signature

    Chill.

    {{ DiscussionBoard.errors[2093364].message }}

Trending Topics