Jump to content

$_Server['request_Method'] Not In Index


markhutch

Recommended Posts

It's been a while since I coded PHP so I'm more than happy to admit I've made a newbie mistake somewhere - but I don't see where!

 

If I view the following in a browser I get everything I would normally expect:

 

http://localhost/?phpinfo=1

 

Including:

_SERVER["REQUEST_METHOD"] GET

 

 

However, when I have the following code:

if ($_SERVER["REQUEST_METHOD"]=="POST") { ...

 

I get this error:

PHP Notice: Undefined index: REQUEST_METHOD in C:\Documents and Settings\Administrator\Local Settings\Application Data\ActiveState\KomodoIDE\6.1\samples\php_tutorials\guestbook.php on line 40

 

(The code above is line 40 of course :)

 

There are SOME $_SERVER values that I can access, like SCRIPT_NAME or PATH_TRANSLATED. Just not the ones I'm trying to access.

 

What am I missing?? This is being run on a freshly installed WampServer 2.2.

Link to comment
https://forums.phpfreaks.com/topic/269169-_serverrequest_method-not-in-index/
Share on other sites

Your IDE is probably running php through the command line, and not the web server. Request methods, post, get,... are specific to making http requests.

 

Like PFMaBiSmAd already mentioned are you running the file under http://localhost or are you running it inside the editor Komodo?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.