1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

syntax problem

Discussion in 'PHP' started by deepman007, May 2, 2008.

  1. #1
    hi

    Is the following syntax correct ?

    echo("<img src="../images/update.gif">");
     
    deepman007, May 2, 2008 IP
  2. lightninggate

    lightninggate Guest

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try the line below
    echo("<img src=\"../images/update.gif\">");
     
    lightninggate, May 2, 2008 IP
  3. Altari

    Altari Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No. You have to stagger your quotation marks or escape with slashes.
    
    echo("<img src='../images/update.gif' />");
    
    Code (markup):
    
    echo("<img src=\"../images/update.gif\" />");
    
    Code (markup):
     
    Altari, May 2, 2008 IP
  4. deepman007

    deepman007 Peon

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It does not work.
     
    deepman007, May 2, 2008 IP
  5. lightninggate

    lightninggate Guest

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Strange worked fine for me. How bout trying this...

    echo '<img src="../images/update.gif">';
     
    lightninggate, May 2, 2008 IP
  6. metabinltd

    metabinltd Well-Known Member

    Messages:
    146
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #6
    dont forget this way of doing things..
    <?
    //my php code

    ?><img src="../images/update.gif"><?

    //etc..
     
    metabinltd, May 2, 2008 IP
  7. Altari

    Altari Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Touche to Occam's Razor. :)
     
    Altari, May 2, 2008 IP
  8. deepman007

    deepman007 Peon

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Do i have to take off both () ?
     
    deepman007, May 3, 2008 IP
  9. deepman007

    deepman007 Peon

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Here's the code

    <input name="Update" type="submit" class="dateup" id="Update" value="<?php if(isset($_SESSION["customerID"]) && $_SESSION["customerID"] != "0") { echo("Update"); }else{echo("Register");}?>">
    Code (markup):
    I want to replace "Update" and "Register" with images.
     
    deepman007, May 6, 2008 IP
  10. Altari

    Altari Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #10
    <input type='image' src='".$image_source."' /> etc etc
     
    Altari, May 6, 2008 IP
  11. deepman007

    deepman007 Peon

    Messages:
    99
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Sorry for not making clear. I want replace the word "update" and "Register" in both echo statements for image.
     
    deepman007, May 9, 2008 IP