Jump to content

[SOLVED] Mixing PHP and Javascript


Chevy

Recommended Posts

Hmmm...how to ask this.

 

This is my array in my javascript:

 

var menu2=new Array()
menu2[0]='<a href="http://www.test.com/inventory.php?act=play&id=$item[id]">Play</a>'
menu2[1]='<a href="http://www.test.com/inventory.php?act=feed&id=$item[id]">Feed</a>'
menu2[2]='<a href="http://www.test.com/inventory.php?act=equipt&id=$item[id]">Equipt</a>

 

Now when it displays on the page, the link looks like this "http://www.test.com/inventory.php?act=play&id=$item[id]"

 

I want it to be like: "http://www.test.com/inventory.php?act=play&id=1"

 

$item['id'] is defined, so I do not know what the problem is?

Link to comment
https://forums.phpfreaks.com/topic/72311-solved-mixing-php-and-javascript/
Share on other sites

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.