Not working URL in Image source [closed] - php

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

Related

add attributes to image woocommerce product [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I would need a little help if I could. I have a store type web site made in wordpress. From anywhere on the site you want to enter the product page you can do it only if you click on the title. I want to make it possible to enter the product page and if you click on the image.
Below I attach the images with the code.
https://airless-consulting.ro/wp-content/uploads/2020/12/imagine_produs.jpg
https://airless-consulting.ro/wp-content/uploads/2020/12/titlu_produs.jpg
Do you have any suggestions?
Why don't you add a link on the image? Try this:
<a href="<?php echo esc_url($link); ?>">
<img src="" alt="" />
</a>

Route to image in Laravel [closed]

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 4 years ago.
Improve this question
I am using the Laravel framework and trying to display an image in a view. Here is the code in the show template that displays the image.
<img src="storage/cover_images/{{$post->cover_image}}">
In this file, I define the storage directory for the image
But the image won't show in the browser, it just pointing to this path
http://localhost/lsapp/public/posts/storage/cover_images/noimage.jpg while my images are in the lsapp/storage/app/public/cover_images folder.
Based on your question..as you want to display image in view.
run Command: php artisan storage:link
after that now you can display your image in view using Storage:url
<img src="{{ Storage:url($post->cover_image) }}">
Make sure to post code next time instead of screenshot.

Wordpress Banner / PHP - Check if a certain image file exists, otherwise use a fallback banner [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Is this possible. I want to do something like the wordpress header/theme having a default image banner, but it won't use it unless the specified image file does not exist.
The logic should work like this
if (this img file does not exist) then use (this default/fallback image as banner)
Are you looking for something like this?
if (file_exists($img)){
echo "<img src='$img' alt=''>";
} else {
echo "<img src='fallback_image.jpg' alt=''>";
}
You might need to specify more details in your question if not, but file_exists() should do the trick.

image is not showing in wordpress theme [closed]

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 8 years ago.
Improve this question
I am new in making word press theme. I am trying to call a image from a images folder which is in the theme folder of word press but when I refresh the page then all the page is disappear and nothing is showing even not any php error.
i want to show my logo in the wordpress theme which is like in the image
I think it has to be get_template_directory_uri() instead of get_template_directory_url() (lowercase i instead of lowercase l).
You also can use bloginfo. See: http://codex.wordpress.org/Function_Reference/bloginfo
In your case:
<img src="<?php bloginfo('template_url'); ?>/images/logo.jpg" alt="<?php bloginfo('name'); ?>">
And of course make sure you're image is in the right location.

Image is not loading in website [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am having trouble showing an image on a webpage. The URL to the image is correct, yet it doesn't show the image, but rather the alternative text.
This is the IMG code:
<img scr="../../images/badges/<?php echo $blog_post['content']; ?>" alt="" />
The html output is this:
<img scr="../../images/badges/acht.png" alt="received-badge" />
I double checked the URL to the image, but that is correct.
The code is also not wrong and the PHP variable is always filled with a default value. These images do exist.
I know it should work, because there are more file I include with PHP using the "../../" structure in the URL.
I really feel stupid to not get it to work.
EDIT: I forgot to mention, that I checked FireBug in FireFox and in the "Net" tab it should show all the images that should be loaded and there is nothing there.
Anyone got an idea?
Thanks in Advance,
Mark Dijkema
Change scr to src, you have typo :)
<img scr... should be <img src....

Categories