vBulletin Hosting - Find jobs - Debt Consolidation - Wordpress Themes - Debt Consolidation

PDA

View Full Version : Help me in this work


balasun
Feb 28th 2008, 11:19 pm
Hello!


I want to concatenate PHP variables with JavaScript. But it does not work;

My code is as follows:<?php

$name3 = "http://a1708.g.akamai.net/7/1708/110/AH0632217021784/www.shopnbc.com/images/linkshare_banners/logos/shopnbc_125x125.gif";
echo '<script type="text/javascript">
seqslides[0]=["$name3", http://www.dynamicdrive.com"]
</script>';


?>

Help me to concatenate above $name3 variable with javascript. Pls

nico_swd
Feb 29th 2008, 12:16 am
Because the string you're echoing is between single quotes, and variables won't be parsed between single quotes. Use double quotes, or do:

echo '<script>... "' . $name3 . '" ...</script>';