#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Sydney, Australia
    Posts
    5
    Rep Power
    0
    Hi
    I have a problem that I need some help with.
    I want to concatenate 2 or more variables, one of which contains some html code ie
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    $var1 = "Dev";
    $var2 = "<font color="#FFFFCC">Shed</font>";

    $doc_head = $var1 . var2;

    echo ($doc_head);
    [/code]
    This produces output that looks like this:
    Dev<font color="#FFFFCC">Shed</font> instead of DevShed with the "Shed" part having a blue colour.
    What do I need to do to produce the desired result?

    Thanks in advance.
    Graham


    [This message has been edited by grahamg (edited October 10, 2000).]
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,648
    Rep Power
    4493
    I don't understand what your desired result is....can you explain??

    Do you want it to end up like this?

    <font color="#FFFFCC">DevShed</font>

    Is it always the font color tag? Are you always adding additional words between the tags?

    Why not store <font ...> in one variable, </font> in another, then concatenate all of your words together?

    ---John Holmes...

    ------------------
    *************************************************************
    * The manual can probably answer 90% of your questions...
    *
    * PHP Manual. www.php.net/manual
    * MySQL Manual: www.mysql.com/documentation/mysql/bychapter
    *************************************************************
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    Well the only problem I see is in the following line:
    $doc_head = $var1 . var2;
    should be:
    $doc_head = $var1 . $var2;
  6. #4
  7. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Location
    Sydney, Australia
    Posts
    5
    Rep Power
    0
    Ok everyone can stop panicing now.
    I found the problem. It was me, too smart for my on good.
    What I showed as an example works exactly as I intended (aside from the minor syntactical error).
    It's just that I was doing something completely different (and incorrectly in my code).

    Thanks for listening.
    Graham

Similar Threads

  1. calling a variable in the html with javascript
    By grungefade in forum JavaScript Development
    Replies: 4
    Last Post: February 10th, 2004, 05:34 PM
  2. How to get client email??Help plz
    By Gecko22 in forum ASP Programming
    Replies: 12
    Last Post: January 22nd, 2004, 02:40 PM
  3. not returning records when it should
    By aliaga61 in forum ASP Programming
    Replies: 3
    Last Post: January 16th, 2004, 11:57 AM
  4. 'Object required' error
    By aliaga61 in forum ASP Programming
    Replies: 1
    Last Post: January 16th, 2004, 09:48 AM
  5. variable not echoing
    By doctacrazy in forum PHP Development
    Replies: 8
    Last Post: December 24th, 2003, 03:12 AM

IMN logo majestic logo threadwatch logo seochat tools logo