-2
$postdata = file_get_contents("php://input");

this code give value like given below

string(53) "user_name=test&password=471476&sessionId=1&userType=1"

I need to insert the values in table.

how can I insert the values?

$keywords = preg_split("/[\s,]+/", $postdata);
print_r($keywords);
empiric
  • 7,825
  • 7
  • 37
  • 48
dora
  • 7
  • 5
  • Fun Fact: When you submit a form via GET the values usually get logged in the web server logs, so if you're submitting logins via GET you've got a nice log full of plaintext credentials prime for stealing/leaking. Use POST. – Sammitch Sep 24 '19 at 16:05

1 Answers1

-2

Theres a builtin function:
parse_str()

Code Spirit
  • 3,992
  • 4
  • 23
  • 34
  • 1
    this is not an answer to the question; this is at best a comment. – jibsteroos Sep 24 '19 at 11:48
  • @jibsteroos The question was, how to parse a query string and this is the answer. The length of a answer does not determine if its a comment or not. And even the marked as duplicate states what I do in my answer. – Code Spirit Sep 24 '19 at 11:49
  • it's working... great thank you so much – dora Sep 24 '19 at 11:50