View Single Post
Old 09-27-2010, 04:15 AM   #2 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

What I think you are trying to do is impossible, PHP can not be executed from javascript because they happen at different stages. Here is a simplified breakdown of a web request

Browser makes request to page -> Server gets request and information and processes page (PHP, ect...) -> Page outputs HTML back to browser -> Browser processes client side stuff (HTML, Javascript, flash, ect).

The PHP is done running and has already sent its output by the time the first line of javascript runs.

The only way to get a similar outcome is to use ajax.
__________________

Village Idiot is offline  
Reply With Quote