php add alt tag

Discussion in 'PHP' started by irdogg, Aug 22, 2010.

  1. #1
    $contentlist.= "<tr onmouseover=\"this.style.backgroundColor='#D5BD77';\" onmouseout=\"this.style.backgroundColor='#E8D8A7';\">
                                        <td width=\"10%\">".$categoryicon." [alt here]</td>
                                        <td width=\"90%\"><span class=\"media\">".$contentlink."</span></td>
                                      </tr>";
    Code (markup):
    im trying to insert the alt in [alt here] im stuck help please :)
     
    irdogg, Aug 22, 2010 IP
  2. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #2
    Are you sure, ".$categoryicon." looks like that's where it needs to go... are there any references to <img src= on your script ?
     
    MyVodaFone, Aug 22, 2010 IP
  3. irdogg

    irdogg Well-Known Member

    Messages:
    358
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    135
    #3
    yes that the category icon im trying to give it and alt tag
     
    irdogg, Aug 22, 2010 IP
  4. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #4
    Yes thats what I meant, but ".$categoryicon." will display <img src="images/someCatIcon.gif" <<<< and its here you need to add alt="" before the closing tag> not outside the <img opening or closing> tag.

    Have a look through your script again and see if you can find <img tags
     
    MyVodaFone, Aug 22, 2010 IP
  5. irdogg

    irdogg Well-Known Member

    Messages:
    358
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    135
    #5
    i sent u the code in pm
     
    irdogg, Aug 22, 2010 IP
  6. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #6
    on line number 315 and 319 you will see <img

    change that on both lines to <img alt=\"\"
     
    MyVodaFone, Aug 22, 2010 IP
  7. irdogg

    irdogg Well-Known Member

    Messages:
    358
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    135
    #7
    that deletes the image and just displays the url of the image
     
    irdogg, Aug 22, 2010 IP
  8. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #8
    I sent you a pm:

    Find this:
    
     $categoryicon = "<img src=\"".$base_url."images/".$categoryicon."\">";
            }
    		    }
            else
            $categoryicon = "<img src=\"".$base_url."images/unknown.gif\">";
    
    PHP:
    And Change to this:
    
     $categoryicon = "<img alt=\"\" src=\"".$base_url."images/".$categoryicon."\">";
            }
    		    }
            else
            $categoryicon = "<img alt=\"\" src=\"".$base_url."images/unknown.gif\">";
    
    PHP:
     
    MyVodaFone, Aug 22, 2010 IP
    irdogg likes this.
  9. irdogg

    irdogg Well-Known Member

    Messages:
    358
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    135
    #9
    MyVodaFone thank u this is a very kind guy!
     
    irdogg, Aug 22, 2010 IP