I have a couple questions regarding how php works with javascript. If there are already threads and/or links that answers these questions, you can just link me to them instead of going through the whole process of explaining it to me.
Basically, can/how does php and javascript pass variables back and forth to each other.
Example one:
If I want to delete something from a database, I want to display a javascript confirmation message if this is really what they want to do or not. The confirmation is in javascript but everything else is in PHP. I would need to test if the confirmation is true or not and depending on that preform different php functions.
Example two:
On one of my pages I have a form that is filled out for different client problems when they call in. I want to enable it so after a client name is filled in and I leave the form "name" field, it will preform a database query for that name and return the results back to the form filling in the rest of the information for that client; such as address, phone, ext. I know how to pass form variables from one page to another with javascript, and I know how to setup the PHP query. I just can't figure out how to link the two languages so they work together. I've read Kevin's "No-Refresh Links" article and have tried this type of technique to do the query, but I don't know how to then pass the variables back to the parent page's form to fill in the rest of the information.
There are other situations where I use javascript and PHP hand in hand. I usually do a print("<script>bla bla bla</script>"); type of deal and it works pretty good, but if I have to pass variables or information from one to the other, I run into problems.
Any help and/or resources anyone can provide would be greatly appreciated.





/b></p></td>
Bookmarks