Maarten00
Maarten00

Reputation: 704

Add data to ResponseText before it gets sent back.

I am using a JQXHR to post data to my server which adds it to a database. When I add something to the database, I want to return the ID of the article I just added to my DB. Is there any way to add something to the Responsetext before it gets sent back to the client?

Upvotes: 0

Views: 73

Answers (1)

flec
flec

Reputation: 3019

The response text is the output of your php-file. That means you can do something like this in your code:

  1. Insert data into db
  2. Get id form db
  3. echo $id;

Upvotes: 2

Related Questions