SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Jun 26, 2007, 00:46 #1
- Join Date
- Jul 2002
- Location
- Wales
- Posts
- 175
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Trying to construct a JS line in PHP, problem...
Hi All,
I'm trying to construct a simple Javascript line (used in a swap image) using PHP. Here it is:
PHP Code:<a href="javascript:;" onclick="MM_swapImage('bigimage','','<?php $this->absolute_path . 'images/large/' . $vehicle['int_main'];?>',1)">
The contructed line looks like this:
PHP Code:<a href="javascript;:" onclick="MM_swapImage('bigimage','','',1)">
PHP Code:<a href="javascript;:" onclick="MM_swapImage('bigimage','','images/large/dsc_3647.jpg',1)">
Many thanks
Rob
-
Jun 26, 2007, 00:55 #2
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
You're missing the word "echo" to tell it you want to output that variable.
PHP Code:<a href="javascript:;" onclick="MM_swapImage('bigimage','','<?php echo $this->absolute_path . 'images/large/' . $vehicle['int_main'];?>',1)">
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Jun 26, 2007, 01:27 #3
- Join Date
- Jul 2002
- Location
- Wales
- Posts
- 175
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Such a simple error, sometimes I cannot see the wood for the trees!!!
Thank you
Bookmarks