0

I'm submitting form using jQuery serialize() function and I'm getting this on PHP page:

[data] => title=Demo&days=2;

But when I'm using echo or to save $_POST['days']value into variable I'm getting Undefined index: days

How to resolve it?

  • Serialize means turning something into a string, if you turn something into a string you need to turn it back into an array if you wish to access it like that. Do a var_dump on $_POST and see how the data looks so you can parse it. – Chris Mar 06 '16 at 21:02

1 Answers1

0

If data is the posted variable then you have to parse the string in your PHP script. If it's a GET request and that's the url you need to use $_GET instead.

purpleninja
  • 376
  • 3
  • 11