View Single Post
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: How to call a PHP function from Javascript and return the results back into Javas

 
0
  #5
Jun 11th, 2008
I would use an ajax call to the following script.

  1. $allowedfuncs = array([allowed function calls])
  2.  
  3. if(in_array($_get['funccall'], $allowedfuncs))
  4. {
  5. $func = $_get['funccall'];
  6. $output = $func(); // This calls $_get['funccall']()
  7. echo $output;
  8. }
  9. else
  10. {
  11. exit();
  12. }
  13.  
  14. /*
  15. functions go here
  16. */

//Or something along those lines. Don't see a need for an iframe.
Last edited by peter_budo; Jun 16th, 2008 at 8:51 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote