EchoFool Posted July 5, 2010 Share Posted July 5, 2010 Hey, I have been trying to find a simple demo script for passing variables with ajax but to no avail any has really made any sense to me. I was wondering if some one could simple show a crude example of how to send a variable from a php script to a different php script and return it. For example: PHP1 script:Send $Var to PHP2PHP2 script: Assign to $Var2 do some processingSend $Var2 back to PHP1 Can some one please show me a simple example so i can fiddle with and learn from it. Thanks Quote Link to comment Share on other sites More sharing options...
trq Posted July 5, 2010 Share Posted July 5, 2010 This is a very simple example written by the guy who first wrote php. You would however be much better off using a framework such as jQuery these days. Quote Link to comment Share on other sites More sharing options...
EchoFool Posted July 5, 2010 Author Share Posted July 5, 2010 Oh i did not know jquery did it also... which is easiest/server efficient (if the script in question is calling a php script every half a second) To give idea of what im doing im trying to build a live chat with ajax (which is already working) as it calls a script which loads out the logs but currently it does not do any checks if there are new messages, as i only want it now to call if there are new messages which will add to server efficientcy. EDIT: fixed typos. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.