|
Home > Archive > Apache Server configuration support > February 2006 > Newbie - 403 Forbidden on POST attempt
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Newbie - 403 Forbidden on POST attempt
|
|
| Robert 2006-02-26, 11:24 am |
| Thanks in advance for your response and suggestions!
I have a page with a contact info form that uses php to send an email when
the visitor presses <Submit>. (In case you need to see the php code, I have
included it at the bottom of this post.) We had to downgrade our Apache
installation from Apache v2 to v1.3.22 for another site we setup. Now our
form <Submit> doesn't work.
Originally we were getting this message:
Method Not Allowed
The requested method POST is not allowed for the URL /demores.php.
In a possibly misguided attempt to fix it, we added the ".php" handler:
<VirtualHost *>
ServerAdmin admin@graylint.com
DocumentRoot "P:\WWW\CaseWorth.com"
ServerName www.CaseWorth.com
ErrorLog logs/error.log
CustomLog logs/access.log common
Options +Indexes +ExecCGI
AddHandler cgi-script .cgi .php <======= Here
</VirtualHost>
After that change the error is different:
403 Forbidden
You don't have permission to access /demores.php on this server.
Question 1) Did we do the right thing adding the .php handler, or should we
remove it?
Question 2) How do we set the required permissions to resolve the "403
Forbidden" error?
Thanks!
Robert
Here is the php code we are running to send the email:
<?php
$to = 'info@mailserver.com';
$subject = "CaseWORTH Demo Request";
$message = "<b>Information follows:</b><BR><BR><b>Contact:</b>
$Contact_Name<BR><b>Email:</b> $Email<BR><b>Phone:</b>
$Phone<BR><b>State:</b> $State<BR><b>Comments:</b> $Comments";
$headers = "From: info@mailserver.com\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";
// Send
mail($to, $subject, $message, $headers);
?>
| |
| Robert Ionescu 2006-02-26, 11:24 am |
| Robert wrote:
> AddHandler cgi-script .cgi .php <======= Here
> </VirtualHost>
> Question 1) Did we do the right thing adding the .php handler, or should we
> remove it?
No, it should be removed. php is loaded either as an apache module or
runs as CGI (PHP, not your standalone script). Can you run your PHP
scripts without errors (exept this one)
> Here is the php code we are running to send the email:
How does your <form .....> element look like? I saw an issue like this
one in the past where the <form> element had some errors, but I cannot
remember what was wrong there.
--
Robert
| |
| Robert 2006-02-26, 11:24 am |
| Thanks for your help Robert.
I removed the ".php" so now I'm back to this result:
405 Method Not Allowed
The requested method POST is not allowed for the URL /demores.php.
> Can you run your php scripts without errors (exept this one)
I don't think we have any other php on the website, so I'm not sure how to
test to see if other code works.
> How does your <form .....> element look like?
Here is the page. I certainly don't mind you taking a look. Please feel
free to enter some information and click <Submit>. I don't think there is
anything wrong with the form, but I'd be glad to have someone else look at
it.
Thanks!
Robert Gray
"Robert Ionescu" <robsiegen@googlemail.com> wrote in message
news:dtksmt$7tk$1@online.de...
> Robert wrote:
>
>
> No, it should be removed. php is loaded either as an apache module or runs
> as CGI (PHP, not your standalone script). Can you run your php scripts
> without errors (exept this one)
>
>
> How does your <form .....> element look like? I saw an issue like this one
> in the past where the <form> element had some errors, but I cannot
> remember what was wrong there.
>
> --
> Robert
| |
| Robert Ionescu 2006-02-26, 11:24 am |
| Robert wrote:
> I don't think we have any other php on the website, so I'm not sure how to
> test to see if other code works.
A little bit OT but did you download php from
http://www.php.net/downloads.php?
To test if apache is configured correctly, use a simple php code like
<?php
phpinfo();
?>
> Here is the page. I certainly don't mind you taking a look. Please feel
> free to enter some information and click <Submit>.
Looks like the URL was filtered some way?
--
Robert
| |
| Robert 2006-02-26, 11:24 am |
| To: Robert I
You are going to laugh (I hope), but I think you already suspect what might
be going on. Honestly, I can't find any evidence of php being installed on
the server. I didn't set the server up, I don't maintain it (thankfully!)
and the regular guy is not available. We all just assumed it was there, but
maybe it isn't. I thought it would be pretty simple to figure out, but I'm
thinking I would be better off to wait for the guy that did set it up. I'm
honestly not sure he knows that much about it either, but he does know more
than me.
I really appreciate you taking the time to work with me on it. If you don't
mind, I'll post more if we still have trouble after we verify what we
actually have installed.
Thanks again for your time.
Robert G
"Robert Ionescu" <robsiegen@googlemail.com> wrote in message
news:dtl206$kek$1@online.de...
> Robert wrote:
>
> A little bit OT but did you download php from
> http://www.php.net/downloads.php?
>
> To test if apache is configured correctly, use a simple php code like
>
> <?php
> phpinfo();
> ?>
>
>
> Looks like the URL was filtered some way?
>
> --
> Robert
|
|
|
|
|