php contact form error

Looking for volunteers to join your project? Need help with a script but can't afford to pay? Want to offer your services as a volunteer to build up your portfolio? This is the place for you...

Moderator: General Moderators

Post Reply
thanovice
Forum Newbie
Posts: 2
Joined: Wed Aug 19, 2009 3:28 pm

php contact form error

Post by thanovice »

Hi am having the following problem. :cry:
My feedback form not working, comes back with and server error (1)
the htaccess code is (2)
php form file (3)
php contact1. ini (4)

any help would be really appricated :D

1. Internal Server Error

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

Please contact the server administrator, webmaster@me--time.co.uk 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.
Apache/2 Server at http://www.me--time.co.uk Port 80

2. htaccess file

AuthUserFile /home/sites/me--time.co.uk/public_html/.htpasswd
AuthGroupFile /home/sites/me--time.co.uk/public_html/.htgroup

AuthName "Web Builder"
AuthType Basic

<FILES .htpasswd>
deny from all
</FILES>

<FILES .htgroup>
deny from all
</FILES>

3. php form file
<?php $c=parse_ini_file("./contact1.ini");foreach($_POST as $k => $v){$i->$k=strip_tags(str_replace("\n","",$v));if(strlen($i->$k)>$c['maxLength']){header("Location: ".$c['onError']);exit;}}if(!$i->subject){$i->subject=$c['defaultSubject'];}if(($c['validateMessage']&&!$i->message)||($c['validateName']&&!$i->name)){header("Location: ".$c['onError']);exit;}if($c['validateEmail']){if(stristr($i->email,"@")){list($u,$h)=Split("@",$i->email);}else{$u="";}if(!$u||!$i->email||!checkdnsrr($h,"MX")){header("Location: ".$c['onError']);exit;}}$h="Content-type: text/html; charset=utf-8\nMIME-Version: 1.0\nFrom: \"".$i->name."\" <".$i->email.">\n"."Reply-to: ".$i->email."\n";if(Mail($c['sendTo'],$i->subject,$i->message,$h)){header("Location: ".$c['onSuccess']);}?>

4. contact1.ini file

; Please set your contact configuration below.
;
; http://www.me--time.co.uk/

[contact] ; info@me--time.co.uk sendTo = "info@me--time.co.uk"

; whether or not to validate the following fields
validateName = true
validateEmail = true
validateMessage = true

; subject when left empty
defaultSubject = "Website Feedback"

; page to redirect to on an error
onError = "contactError.html"

; page to redirect to when successful
onSuccess = "contactSuccess.html"

; maximum length of any input
maxLength = 4096
Post Reply