PHP Image simple problem need help...

Discussion in 'PHP' started by dhisky, Nov 27, 2009.

  1. #1
    Hello,

    I need help regarding php image on html img src. I cant find to work it. I'm not familiar with php and I'm editing it. Can someone pls do fix this for me?


    <img src="<?php echo $site_url.$template_url; ?>/images/logo.png> border="0" />


    It's not working here...

    Thanks!
     
    dhisky, Nov 27, 2009 IP
  2. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #2
    <img src="<?php echo $site_url.$template_url; ?>/images/logo.png> border="0" />

    should be

    <img src="<?php echo $site_url.$template_url; ?>/images/logo.png" border="0" />


    you had a > instead of " after logo.png
     
    n3r0x, Nov 27, 2009 IP
  3. spc

    spc Well-Known Member

    Messages:
    136
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    125
    #3
    Also make sure $template_url does not ends with a /

    For example if you use
    
    $site_url="http://www.yahoo.com/";
    $template_url="templates/";
    
    Code (markup):
    So that $site_url.$template_url will result
    
    http://www.yahoo.com/templates/
    
    Code (markup):
    and then your code will output like

    
    <img src="http://www.yahoo.com/templates[U]//[/U]images/logo.png" border="0" />
    
    Code (markup):
    Look the underlined part in above code. Hope I could explain clearly.
     
    spc, Nov 28, 2009 IP
  4. dhisky

    dhisky Peon

    Messages:
    207
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks guys! Problem Solved!
     
    dhisky, Nov 28, 2009 IP