Is it possible to use the results of a JavaScript function in PHP?
Let me break down why. I have a table that has several columns, including a column that gives each row a checkbox. When a user presses an edit
button, an onclick
event is activated. The onclick
event does a few things, but primarily it goes through the table and figures out which checkboxes are clicked, and returns an array of numbers which indicate the IDs of the entries of the selected rows.
What I want to know is how can I take these Ids
and use them in my inline php code that should use the Ids
to get corresponding data from a database and generate a new table.
Also, is there another way of doing this type of thing? This seems a little convoluted. I've tried XMLHTTPRequests
to get the data directly with Javascript but I had trouble/couldn't get past using the GET
method of an XMLHTTPRequest
. My code would execute, but I wasn't sure how to get/use the data.
Any help is appreciated.