All I want is that in php script 1 that has the .post javascript jquery lib code. I want php script 1 to send a form submission to php script 2 that would take those values and update the database. Then with php script 2 I want to send a variable back to php script 1 to let it know that the update went good or not.
on php script 1 I have a variable called success I first assign a zero to it. Then run the .post code and expect to have the success variable assigned a 1 to it.
on php script 1 after the .post I have a switch with 2 cases one if success is 1 then I have a string saying " Database updated in good terms". I then have another case where success is 0 then a string says " sorry the attempt failed please try again".
Those strings are assigned to a variable called db_status.
So I then append db_status in the div. Which displays that string message.
I know how I can use .post and get html code from the php file on the callback of .post.
I just want to know how I can pass back javascript or php variables.