Hi, can anyone tell me how to add the php that I've added to the line starting var ch_queries so that the script still works (at the moment it breaks). Thanks for any help. <script type="text/javascript"><!-- ch_font_title = "Verdana"; ch_font_text = "Verdana"; var ch_queries = new Array( "<?php if (content_format('field_ad_text', $field_ad_text[0]) != '') : ?> <?php foreach ($field_ad_text as $ad_text) { ?> <?php print content_format('field_ad_text', $ad_text) ?> <?php } ?> <?php endif; ?>" ); var ch_selected=Math.floor((Math.random()*ch_queries.length)); if ( ch_selected < ch_queries.length ) { ch_query = ch_queries[ch_selected]; } //--></script> <script src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"> </script> Code (markup):
<script type="text/javascript"><!-- ch_font_title = "Verdana"; ch_font_text = "Verdana"; var ch_queries = []; <?php if (content_format('field_ad_text', $field_ad_text[0]) != '') : ?> <?php foreach ($field_ad_text as $ad_text) : ?> ch_queries.push(<?php echo content_format('field_ad_text', $ad_text) ?>); <?php endforeach; ?> <?php endif; ?> var ch_selected=Math.floor((Math.random()*ch_queries.length)); if ( ch_selected < ch_queries.length ) { ch_query = ch_queries[ch_selected]; } //--></script> <script src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript"> </script> PHP: Try this one.