Change php Variable using javascript

Hello Guys i want to know how to change php variable
i want to show more posts
when user click on a button when user click on button show more posts

You can’t change the value of a PHP variable in JavaScript. PHP runs on the server and JS runs on the client PC. You can pass values between a PHP script and a JS script but I don’t think that will help you here.

It sounds to me as though you need a PHP solution, that when a users presses your show more posts button, you initiate a new PHP query.

An alternative could be an infinite scroll.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.