ruraldev
08-24-2010, 03:33 PM
SOLVED
I am trying to use a php variable in javascript.
At the moment I am using a fixed variable
$articleID = 5;
Then outputting it to the page to declare a javascript variable
var articleid = "<?php echo $articleID; ?>";
Then trying to us it within a string
"FlashVars", "fileURL=../uploadedfiles/+ articleid + .gpx&key=ABQIAAAAOQBC.........
Can anyone tell me what I am doing wrong? I am not very used to Javascript and perhaps I am going about it totally the wrong way.
Help!
Gordon:confused:
I am trying to use a php variable in javascript.
At the moment I am using a fixed variable
$articleID = 5;
Then outputting it to the page to declare a javascript variable
var articleid = "<?php echo $articleID; ?>";
Then trying to us it within a string
"FlashVars", "fileURL=../uploadedfiles/+ articleid + .gpx&key=ABQIAAAAOQBC.........
Can anyone tell me what I am doing wrong? I am not very used to Javascript and perhaps I am going about it totally the wrong way.
Help!
Gordon:confused: