problem in dispalying Image
Posted: Sun Apr 04, 2010 11:45 am
am facing problem in displaying image....As when the image source is in the form of http://....its working but when its in the form of C:\wamp\www..... its not working ...Plz help me...
working code
Not working code
Can any1 plz modify my not working code.....as i m using this code in joomla therefore JPATH_ADMINISTRATOR gives the actual path which is like "C:/wamp/www/...." therefore i cannot use http method which is working
working code
Code: Select all
echo '<td align="center" width="25%"><a title="'.$row[0].'" href="' . $link . '"><img src="http://localhost/Joomla_1.5/administrator/components/com_gallery/uploads/tb_60.jpg" height="66" width="90" alt="Painting" border="0" /><br /><br/>
' . $row[0] . '</a></td>';Code: Select all
$path = JPATH_ADMINISTRATOR.DS. 'components'.DS.$option.DS.'uploads'.DS.'tb_60.jpg';// or $path = "C:/wamp/www/Joomla_1.5/administrator/components/com_gallery/uploads/tb_60.jpg";
echo '<td align="center" width="25%"><a title="'.$row[0].'" href="' . $link . '"><img src="' . $path. '" height="66" width="90" alt="Painting" border="0" /><br /><br/>
' . $row[0] . '</a></td>';