Want to improve this开发者_开发问答 question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this questionI'm using Following code.
<img src="http://localhost/component/my_task">
its not working. Any idea, Why not?? how can i perform my task in joomla by image source code.
NOTE:: this link perform my task ( MYURL/My_Component/My_Task). is it possible or not??
It's not working because http://www.localhost/my_task does not return a valid image.
Are you sure that you should use www.localhost? Remove the www part if you want it to point your local web server.
use $_SERVER['HTTP_HOST'] replace www.localhost
<img src="http://<?php echo $_SERVER['HTTP_HOST']?>/my_task/test.png">
If you're using Joomla! you could use path this way
<img src="<?php echo $this->baseurl ?>/path/to/your/image/image.jpg">
For ex, if you have your image in the default folder, it should look like
<img src="<?php echo $this->baseurl ?>/images/stories/myimage.jpg">. 
The way you're doing you're not linking to an image, but to a directory....
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论