unexpected T string .... and I can't find it

Discussion in 'PHP' started by webmaster73, Sep 3, 2008.

  1. #1
    hello .

    this line is giving me headaches... I might be too tired and thus can't see it... but there is an unexpected T string somewhere...


    
    <td $i="" :$i="" echo="" $i="" background="/images/top-icons3/header_<?php $i=rand(1,4); $i=$i<=9?" width="748">.jpg"><a href="/vb"><img src="/images/banner/50x50_transparent.gif" border="0" height="112" width="98%" /></a>&nbsp; </td>
    
    
    PHP:
    can you see it ?
     
    webmaster73, Sep 3, 2008 IP
  2. mab

    mab Active Member

    Messages:
    563
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    80
    #2
    First of all what is
    you wanna echo the <td> or ?
     
    mab, Sep 3, 2008 IP
  3. NatalicWolf

    NatalicWolf Peon

    Messages:
    262
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I don't understand what you're trying to accomplish. Because the code is pretty uninterpretable.

    <td background="/images/top-icons3/header_<?=rand(1,4);?>.jpg" width="748"><a href="/vb"><img src="/images/banner/50x50_transparent.gif" border="0" height="112" width="98%" /></a>&nbsp; </td>

    Is that what you want? That is proper PHP syntax. If you want that inside a normal php echo:


    echo '<td background="/images/top-icons3/header_'.rand(1,4).'.jpg" width="748"><a href="/vb"><img src="/images/banner/50x50_transparent.gif" border="0" height="112" width="98%" /></a>&nbsp; </td>';
     
    NatalicWolf, Sep 3, 2008 IP
  4. webmaster73

    webmaster73 Well-Known Member

    Messages:
    133
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #4
    aaaaaaaah. thank you Sir. found it :


    <td width="748" background="/images/top-icons3/header_<?php $i=rand(1,4); $i=$i<=9?"0$i":$i; echo $i;?>.jpg">
        <a href="/vb"><img border="0" src="/images/banner/50x50_transparent.gif" width="98%" height="112"></a>&nbsp; 
    </td>
    PHP:
     
    webmaster73, Sep 3, 2008 IP
  5. webmaster73

    webmaster73 Well-Known Member

    Messages:
    133
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #5
    thank you mab and natalicwolf

    I really appreciate your help
     
    webmaster73, Sep 3, 2008 IP
  6. NatalicWolf

    NatalicWolf Peon

    Messages:
    262
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #6
    No problem, glad to have helped.
     
    NatalicWolf, Sep 3, 2008 IP