Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 11th May 2010, 06:24 AM   #1
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Contact Form Error
Share on: 
fb share twitter share gplus share more share

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?

Chill.
Social Experts is offline  
Unread 11th May 2010, 06:08 PM   #2
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Re: Contact Form Error
Share on: 
fb share twitter share gplus share more share

Anyone? Pleaseeeeeeee

Chill.
Social Experts is offline  
Unread 11th May 2010, 06:46 PM   #3
HyperActive Warrior
War Room Member
 
Manfred Ekblad's Avatar
 
Join Date: 2009
Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
Default
Re: Contact Form Error
Share on: 
fb share twitter share gplus share more share

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...
Manfred Ekblad is offline  
Unread 11th May 2010, 07:30 PM   #4
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Re: Contact Form Error
Share on: 
fb share twitter share gplus share more share

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?

Chill.
Social Experts is offline  
Unread 11th May 2010, 07:41 PM   #5
HyperActive Warrior
War Room Member
 
Manfred Ekblad's Avatar
 
Join Date: 2009
Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
Default
Re: Contact Form Error
Share on: 
fb share twitter share gplus share more share

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();

?>
Manfred Ekblad is offline  
Unread 11th May 2010, 08:33 PM   #6
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Re: Contact Form Error
Share on: 
fb share twitter share gplus share more share

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

Chill.
Social Experts is offline  
Unread 11th May 2010, 09:37 PM   #7
HyperActive Warrior
War Room Member
 
Manfred Ekblad's Avatar
 
Join Date: 2009
Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
Default
Re: Contact Form Error
Share on: 
fb share twitter share gplus share more share

That's it? There should be errors from today, since we had a couple of them already.
Manfred Ekblad is offline  
Unread 11th May 2010, 11:51 PM   #8
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Re: Contact Form Error
Share on: 
fb share twitter share gplus share more share

Yeah that's all I got. I just wanna get it fixed lol

Chill.
Social Experts is offline  
Unread 12th May 2010, 02:19 AM   #9
HyperActive Warrior
War Room Member
 
Manfred Ekblad's Avatar
 
Join Date: 2009
Location: Bandung, Indonesia
Posts: 281
Thanks: 103
Thanked 193 Times in 55 Posts
Default
Re: Contact Form Error
Share on: 
fb share twitter share gplus share more share

could be a corrupt .htaccess-file... u host it urself (dedicated/vps) or u have a "normal" web hosting account?
Manfred Ekblad is offline  
Unread 13th May 2010, 02:29 AM   #10
Check The Abstract.
War Room Member
 
Social Experts's Avatar
 
Join Date: 2010
Posts: 435
Thanks: 9
Thanked 137 Times in 42 Posts
Default
Re: Contact Form Error
Share on: 
fb share twitter share gplus share more share

I'm with hostgator. I just wanna get this sorted

Chill.
Social Experts is offline  
Closed Thread


Bookmarks

Tags
contact, error, form


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




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