How do I access the POST parameters in the server side script of an ajax call

How do I access the POST parameters in the server side script of an ajax call

tonyhyamstonyhyams Posts: 4Questions: 2Answers: 0

I have a simple server side script which updates a row in the database based on a checkbox as per the editor example here https://editor.datatables.net/examples/api/checkbox.html

This works fine except I wanted to run a separate insert on another table when the server side script is called. effectively inserting some php before the editor instance is built . running an insert query then continuing on with the checkbox update as per example.

The only problem I am having is I need to access the data that is being sent over when the checkbox is ticked. I thought I could just do something like

$temp = $_POST["id"];

where id is one of the fields POSTED over. But when I try this I get an error returned saying "id is an undefined index" . So how do I get the data? I assume I am missing something fundamental or just making a simple error.

Answers

  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin

    Hi,

    This sounds like a perfect use case for the PHP library's server-side events. That way you can still fully support multi-row editing and its easy to get the information you want.

    Regards,
    Allan

This discussion has been closed.