hi

I am trying to set a jquery variable to a php variable but it's failing... is this even possible and if so how could it be done? I am doing this right now:

jquery code: var last_page = $(".page-numbers:eq(8)").text();

 <?php $lp = ?> last_page <?php  ; ?> 

thank u!

    You can't directly set variables from javascript to php. You will need to either force the page to post data or redirect (which will cause the page to reload), or use AJAX to send the data to the server to be saved for later use.

    PHP code is execute on the server side, and any output is then sent to the client device (whatever called the php file). Any manipulation of that output data isn't saved unless you send it back to the server.

      i see -okay thank u.

      I was actually able to work it all out in jquery...

      but maybe i will experiment with the ajax here - would really like to learn that actually.

        Write a Reply...