SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru D-flyer's Avatar
    Join Date
    Jan 2001
    Location
    Near a computer
    Posts
    782
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need to set this dynamic?

    Almost there,

    Just need to set this dynamic:

    Code:
    img src="<?= ($currentPage == '1') ? '../images/EN/EN_subNav1_over.gif' : '../images/EN/EN_subNav1.gif'; ?>
    Where i need to replace "EN" with the "$imgSRC"

    Tried this:

    Code:
    <img src="<?= ($currentPage == '1') ? '"../images/".$imgSRC."/".$imgSRC."_subNav1_over.gif"' : '"../images/".$imgSRC."/".$imgSRC."_subNav1.gif"'; ?>"
    Where do i go wrong?

  2. #2
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php // Don't bother ?>

    <img src="<?php echo ($currentPage == 1) ? '../images/'.$imgSRC.'/'.$imgSRC.'_subNav1_over.gif' '../images/'.$imgSRC.'/'.$imgSRC.'_subNav1.gif'?>" />

  3. #3
    SitePoint Guru D-flyer's Avatar
    Join Date
    Jan 2001
    Location
    Near a computer
    Posts
    782
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tnks, works great.

    So for learning purpose i must be carefull with using double " and '

    Another little question: Could you tell me the diff. between <?php echo and <?=

    Thanks

  4. #4
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?= only works if the php short open tags are enabled in the php.ini.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •