I am trying to dynamically get a php variable and place them into my javascript variable as seen below:
var site_url = "getsite.php?name=SiteName&link=linkURL";
That above script is what I have now and it is harcoded(SiteName,linkURL).
I want to change ‘SiteName’ and ‘linkURL’ to display whatever the PHP variable is on another page.
Any help would be great, Thanks.
How is the user arriving at this page from the one with the PHP variables you want to access?
The simplest way would be to store them in the session, like so:
previous page:
then, on the current page:
That should work for you – good luck!