Scandir

I have some php code that gets images from different folder for different users I need an alt tag for the images to pass w3c validation here is the php code
[php]<?php
$dirpath = ‘images/clients/’.$_SESSION[‘username’];
$files = scandir($dirpath);
foreach($files as $file){
if($file==".") continue;
if($file=="…") continue;
echo “

  • <a href=”".$dirpath.’/’.$file.""><img src="".$dirpath.’/’.$file."" >
  • ";
    }
    ?>[/php]

    [php]<img src="".$dirpath.’/’.$file."" alt=".$ALTHERE." />[/php]

    and echo “

  • <a href=”".$dirpath.’/’.$file.""><img src="".$dirpath.’/’.$file."" >
  • "; can be shortened to

    echo “

  • ”;
    Sponsor our Newsletter | Privacy Policy | Terms of Service