Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Question Placing a gif image in php

    I'm trying to insert a gif image right after "hits" number.

    if($this->getConfig('showhits') == 1)
    {
    $output .= "<span class=\"".$csstag."hits\">".JText::_('')." ".$obj->imgcounter."</span><br />\n";

    }

    Here is a code for an image.
    <img src="modules/mod_joompic/ranking_pics/hits.gif"></img>

    It just gives me an error anywhere I place the code above.

    What is the right coding for this? Thanks.

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    PHP Code:
    if($this->getConfig('showhits') == 1)
    {
    $output .= "<span class=\"".$csstag."hits\">".JText::_('')." ".$obj->imgcounter."</span><br />\n";
    $output .= '<img src="modules/mod_joompic/ranking_pics/hits.gif"></img>';

    the .= operator means that the variable is appended.

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • Users who have thanked whizard for this post:

    rod6 (09-06-2009)

  • #3
    New Coder
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Post Solved.

    Thanks a lot. It did work.

    I'm learning PHP and I really liked the way you explained.

    You do have a great day.

  • #4
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Glad you got it working! Never be afraid to ask questions here as you learn!

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

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