Hey Guys: i need help please in htaccess i have a very simple HTML design with simple PHP conatct us form , when i fill the form and hit the Submit button i get the Error 403 access forbidden i googled this i make more than 20 script for htaccess file BUT not a single one make it work i have no idea about it , would u please help me out here i would really apprciated it i will post the HTML and PHP script : Code: <?php $errors = ''; $myemail = '*****@****.com'; if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['message'])) { $errors .= "\n Error: all fields are required"; } $name = $_POST['name']; $email_address = $_POST['email']; $message = $_POST['message']; if (!preg_match( "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", $email_address)) { $errors .= "\n Error: Invalid email address"; } if( empty($errors)) { $to = $myemail; $email_subject = "Contact form submission: $name"; $email_body = "You have received a new message. ". " Here are the details:\n Name: $name \n Email: $email_address \n Message \n $message"; $headers = "From: $myemail\n"; $headers .= "Reply-To: $email_address"; mail($to,$email_subject,$email_body,$headers); //redirect to the 'thank you' page header('Location: contact-form-thank-you.html'); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Contact form handler</title> </head> <body> <!-- This page is displayed only if there is some error --> <?php echo nl2br($errors); ?> </body> </html> the html form Code: <form method="POST" name="contactform" action="contact-form-handler.php"> <p> <label for='name'>Your Name:</label> <br> <input type="text" name="name"> </p> <p> <label for='email'>Email Address:</label> <br> <input type="text" name="email"> <br> </p> <p> <label for='message'>Message:</label> <br> <textarea name="message"></textarea> </p> <input type="submit" value="Submit"><br> </form> maybe in the backage i bought with the hosting i didnt select this kind of services , its from 1AND1 by the way, i really dont know Best regards
Can you call the contact-form-handler.php script directly in your browser, or do you get a 403 as well?
Dear Falko: i get 403 error as well now i get this message even when i try to browse any page Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] 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 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. am using this code in htaccess Code: <Directory /> Allowoverride All </Directory> <Location /> Options +IncludesNoExec -ExecCGI </Location> i really cant do anything your help is really appreciated thanks sooo much
Guys any suggestion may help and is welcome,any suggestion may shed a light on things i cant figure out thanks
You cannot use AllowOverride in an .htaccess file because AllowOverride specifies what can be used in an .htaccess file, and therefore it must go into the main Apache configuration: http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride Did you check Apache's error log?
no i didn't check Apache's error log? how can i ?and maybe i post here to help me out Falko in it i appreciate it so much
Depending on your distribution, Apache's error log will be in /var/log/apache(2)/ or /var/log/httpd/.
Hi I was looking for a contact form with CAPTCHA this week, I searched the net and found this site. http://www.thesitewizard.com/wizards/feedbackform.shtml I selected Create a PHP Feedback Form (Requires PHP 4.2 or above) I followed the instructions, also this will require you to login to Google to get your ReCAPTCHA Public Key and your ReCAPTCHA Private Key if you want to use CAPTCHA. You do not need to alter your .htaccess or add to your htaccess to use this form. mine works fine on a demo site I have. Scorp
i guess i ruin the website now i get this message Error 404 - Not found Le fichier requis n'a pas été trouvé. Il peut s'agir d'une erreur technique. Veuillez réessayer ultérieurement. Si vous ne pouvez pas accéder au fichier après plusieurs tentatives, cela signifie qu'il a été supprimé. whenever i type ANY link even the main website. i get this htaccess in logs directory Code: Options +Indexes Satisfy any Order Deny,Allow Allow from 172.17.0.0/16 Allow from 212.227.35.64/27 Allow from 212.227.34.151 Allow from 212.227.34.190 Deny from all RemoveType .html .gif AuthType Basic AuthName "Access to /logs" AuthUserFile /kunden/homepages/25/d346247991/htpasswd Require user u60784729 i need help guys
so What iam gonna do now is there anyway to restore defalt setting in website server? or anything similar
I don't know what you did exactly. But can't you simply revert all your changes and start from the beginning?