Can not use $_POST method in PhpStorm

Hi all,

I am a newbie with PHP and I am using PhpStorm IDE for developing currently but I had problem with $_POST method. 

Example : 

In my form tag, use method = "post" and there is a textbox with name = "txtName"

In my php file, I use $_POST['txtName'] but after launch my application that a error occur as below : 

Notice: Undefined index: txtName in C:\xampp\htdocs\DemoPHP\project\view\training\form\DemoPostAction.php on line 8
NULL

Why Can not I use POST method in PHPSTorm ?

My PHPStorm version is 2016.3.2. This is lastest version that I downloaded on www.jetbrains.com

Please help me ....

1
4 comments

Hi there,

Based on your description you seem to be using PhpStorm's built-in simple web server (URL will be like localhost:63342/PROJECT_NAME/...). It currently has issues with handling POST requests ($_POST comes in empty) -- https://youtrack.jetbrains.com/issue/WEB-17317

 

Workaround -- use proper web server (your Apache from XAMPP) to serve your files.

How -- see here, for example: http://stackoverflow.com/a/34787827/783119

 

Some other related links:

0
Avatar
Permanently deleted user

hey!!!

I m having same problem...

Are you got any progress in this???

0
Avatar
Permanently deleted user

I found my solution.

I had no longer problems when I updated PHPStorm to the latest version.

This version is 2017.2.2

 

Hopefully this solve your problem

0

Please sign in to leave a comment.