开发者

Not working URL in Image source [closed]

开发者 https://www.devze.com 2023-02-08 18:28 出处:网络
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this开发者_开发问答 question? Add details and clarify the problem by editing this pos
Closed. This question needs details or clarity. It is not currently accepting answers.

Want to improve this开发者_开发问答 question? Add details and clarify the problem by editing this post.

Closed 9 years ago.

Improve this question

I'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....

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号