Jump to content

verifying a notion


simpli

Recommended Posts

Hi,

I haven't started ajax yet but I have been reading books while in the meantime dusting off my js and php. I have a question which pertains with what I'm going to try to achieve later. Ajax is good to retrieve stuff from the server while providing desktop like response. But what if what I want to do is on the server side? For instance when i click a button on the client side, i want a row to be added to a table on the server side? How can I do that? There is nothing in the js that allows me to start such a thing from the client side. Or is it through the php file I call with the XHR that I can get whatever done on the server side?

 

If so, if the row is added, the XHR will not really be returning anything so what signal do I have that the table was indeed added to the table?

 

Thanks for clarifying

J-R

Link to comment
https://forums.phpfreaks.com/topic/152170-verifying-a-notion/
Share on other sites

Hi,

I haven't started ajax yet but I have been reading books while in the meantime dusting off my js and php. I have a question which pertains with what I'm going to try to achieve later. Ajax is good to retrieve stuff from the server while providing desktop like response. But what if what I want to do is on the server side? For instance when i click a button on the client side, i want a row to be added to a table on the server side? How can I do that? There is nothing in the js that allows me to start such a thing from the client side. Or is it through the php file I call with the XHR that I can get whatever done on the server side?

Yeah buddy, you are right. We call the PHP file through XHR which gets the job done.

 

If so, if the row is added, the XHR will not really be returning anything so what signal do I have that the table was indeed added to the table?

 

You could indeed echo "Success"; in the php file if the table row gets added. Then you can display the result from the PHP file which is "Success" in the HTML document.

 

Hope you got my point.

Link to comment
https://forums.phpfreaks.com/topic/152170-verifying-a-notion/#findComment-799206
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.