Digital Point Forums
Western Union

Go Back   Digital Point Forums > Design & Development > Programming > PHP
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Feb 28th 2008, 11:19 pm
balasun balasun is offline
Peon
 
Join Date: Jan 2008
Posts: 29
balasun is on a distinguished road
Help me in this work

Hello!


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

My code is as follows:
Code:
<?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
Reply With Quote
  #2  
Old Feb 29th 2008, 12:16 am
nico_swd's Avatar
nico_swd nico_swd is offline
Starcaller
 
Join Date: Nov 2006
Location: Spain
Posts: 3,819
nico_swd is a splendid one to beholdnico_swd is a splendid one to beholdnico_swd is a splendid one to beholdnico_swd is a splendid one to beholdnico_swd is a splendid one to beholdnico_swd is a splendid one to beholdnico_swd is a splendid one to beholdnico_swd is a splendid one to behold
Because the string you're echoing is between single quotes, and variables won't be parsed between single quotes. Use double quotes, or do:
php Code:
echo '<script>... "' . $name3 . '" ...</script>';
__________________
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple copy/paste work needed, regular work by the hour FinanceGuy Content Creation 50 Dec 24th 2008 4:36 pm
Need Some manual work to be done super quickly. 2-3 Hours copy paste work. aditya_sfs Services 13 Oct 5th 2007 11:52 pm
Needs RSS feeds work bonus if work done early and needs continious work mansec PHP 1 Jun 15th 2007 4:12 am
PAID WORK - Required For - Regular Flash Work & Edits briancollins Graphics & Multimedia 0 Mar 1st 2007 4:19 pm
Web study work required, approx 100 hours of work. patrickberry Services 8 Nov 15th 2006 7:39 am


All times are GMT -8. The time now is 7:20 am.