|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||||
|
|||||
|
Getting "Method Not Allowed" error (HTTP Error 405)
Hi,
I'm new to PHP and am getting 2 error messages with a test project: First error msg (before pressing submit button): "Notice: Undefined variable: MyEmail in ...php_mail_test.php on line 19" Second Error(after pressing submit button): "HTTP Error 405 405 Method Not Allowed. The method specified in the Request Line is not allowed for the resource identified by the request. Please ensure that you have the proper MIME type set up for the resource you are requesting." ============ Statistics: ============ 1) Just installed the latest Windows Install version from PHP.Net and followed the install instructions. 2) Using Win 98 and PWS. 3) When testing my code originally on PHPIntro.com, it worked fine, but not on my own system. 4) Loaded script in my browser (IE6) using following URL: "http://localhost/php_mail_test.php". 5) I use a different home directory than the default home directory, in PWS. And the script is located in that new directory. PWS finds it and executes the HTML okay; but not the PHP part. 6) Here's the code (try viewing in a wide window to help make sense out of my code): php Code:
================ Thanks for any help. |
|
#2
|
|||
|
|||
|
RE: Getting
to fix there first error, change line 19 to:
As for the other, I'm sorry I am not that familar with PWS. I assume there is some option in there somewhere to allow or disallow POST operations, such as the LIMIT directive in apache.... |
|
#3
|
|||
|
|||
|
RE: Getting
Thanks very much Matt. I'll give those suggestions a try.
|
|
#4
|
|||
|
|||
|
RE: Getting
To slove your first problem:
in your php.ini file: Code:
error_reporting = E_ALL & ~E_NOTICE |
|
#5
|
|||
|
|||
|
RE: Getting
oh also change your method from post to get
|
|
#6
|
|||
|
|||
|
RE: RE: Getting
Quote:
That doesn't actually solve the problem, it just hides the error... |
|
#7
|
|||
|
|||
|
RE: Getting
well true but.. works for me
with isset($MyEmail) you would probly get 2 errors: $MyEmail is not set and parm 1 missing from isset. Something like that. |
|
#8
|
|||
|
|||
|
RE: Getting
Actually, the isset() call did solve my first problem. No errors occured. Thanks Matt.
But, the 2nd problem is still there. When I change the request method from POST to GET, I no longer get the "Method not allowed" error, but then it comes up with a "Page cannot be Displayed" error. Not sure why. I also looked around for how to get PWS to accept POST as a request method, but haven't found anything so far. |
|
#9
|
|||
|
|||
|
RE: RE: Getting
Quote:
Actually the isset() function was made to check if a variable is set. That is its job.... |
|
#10
|
|||
|
|||
|
RE: Getting
yes but thereticly you would get an error
|
|
#11
|
|||
|
|||
|
RE: Getting
No...you wouldn't. Read the manual page for isset()...
Quote:
|
|
#12
|
|||
|
|||
|
RE: Getting
why i would think (if i didnt read that page):
if you use a var (if i read this properly) the preprosser fills in the space where the var is used. if the var is used with a function it should send the error |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > Getting "Method Not Allowed" error (HTTP Error 405) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|