Posted By

thesislab on 08/13/09


javascript php uri relative thesis

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Embedded PHP in script for relative link to image

 / Published in: PHP

  1. <div id="multimedia_box2">
  2. <div id="image_box2">
  3. <script language="JavaScript">
  4. <!--
  5. var img_rnd = new Array ("<?php echo THESIS_CUSTOM_FOLDER; ?>/images/puff_pancake_sm.png");
  6. var i = Math.floor(1*Math.random());
  7. document.write('<img src="' + img_rnd[i] + '" width="416" />');
  8. //–>
  9. </script>
  10. </div>
  11. </div>

Report this snippet  


RSS Icon Subscribe to comments
Posted By: thesislab on November 8, 2009

Code provided by DIY Themes forums member asmith (

Posted By: thesislab on November 8, 2009

The important part of this is the immediate PHP tag just after 'new Array' and before '/images/'.

You need to login to post a comment.