Jump to content

PHP variables to Javascript variables?


lalnfl

Recommended Posts

I have this

 

xmlhttp.open("GET","promotions.php?promotion_id=$promotion_id&show_id=$show_id&add_match="+str,true);

 

And I want to have it where the php $_GET variables can transfer into javascript variables so that I can have the $promotion_id and $show_id in the url. When I run my full script, and there is a form on there that goes to the same page, it shows promotions.php?promotion_id=$promotion_id&show_id=$show_id&add_match, but the $promotion_id and $show_id variables should be numbers, but I don't know how to transfer php GET variables to Javascript? Any help?

Link to comment
https://forums.phpfreaks.com/topic/216628-php-variables-to-javascript-variables/
Share on other sites

If you want the url to change you need to change the page.

 

There are ways of placing params within a url using anchor tags which allows book markable Ajax. However, without knowing your specific Ajax implementation you likely won't get allot of help in a simple forum reply.

 

Google 'book marks ajax' or similar and you might find a few tutorials. This is however something that really needs to be though about from the startr of your application design and could require quite a bit of reworking if youve already got a significant amount of code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.