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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.