jmansa — 2011-12-12T02:04:01-05:00 — #1
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
paul_wilkins — 2011-12-12T02:09:22-05:00 — #2
- Client requests page from server
- Server processes PHP and serves the end result as an HTML page
- Client receives the HTML page
jmansa — 2011-12-12T02:56:17-05:00 — #3
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"?
paul_wilkins — 2011-12-12T03:04:49-05:00 — #4
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
jmansa — 2011-12-12T03:38:54-05:00 — #5
Thanks alot... I'm on it