I have an php variable like this:
$pageClass = 'cube';
And I want to be able to change this variable with jQuery and the jQuery is on the same page? Can this be done???
Thanks in advance
- Client requests page from server
- Server processes PHP and serves the end result as an HTML page
- Client receives the HTML page
So what if i Want to change an variable in a iframe. In the page within the iframe lets say from an dropdown menu with an "onChange"?
By the time the page gets to the web browser, all of the PHP code has long since been executed.
If you want PHP to behave differently based on different inputs, you will need to send that info as a request to the server.
That can be done either by sending the data to a request for a new page (commonly by submitting a form request), or it can be done as a partial part of the page without reloading the page by using an AJAX request.
There's a good book that takes you through how to do such things properly, called Bulletproof Ajax
Thanks alot... I'm on it