flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.61k stars 408 forks source link

How can I acces $_POST data? #260

Closed simar88 closed 8 years ago

simar88 commented 8 years ago

Hi everyone, i'm having trouble on gettin the content of $_POST variable sent through ajax. Can you give me some suggestions? Thanks in advance.

lkho commented 8 years ago

http://flightphp.com/learn#requests

You can access the query, data, cookies, and files properties as arrays or objects.

So, to get a POST variable, you can do: $id = Flight::request()->data['id'];

simar88 commented 8 years ago

Hi @lkho, i used all the methods but i was unable to access them. After a lot of reviews on my code, I discovered that I wrote a wrong json reference in my request. It was just my fault! Thanks owever for your support! :)