I have problem to call image with link.
i implementing url management in Yii. it working fine. but. when call image from database. image and link ie if i hover on the image. pages gets render. so dont want to render or refresh the page. i added the code following please where i did mistake. please suggest me how to call the image only
<?php $image = '<img class="img-responsive" src="'.Yii::app()->baseUrl.'/img/'.$small_recipe.'" />';
echo CHtml::link($image, array('name'=>$reciep_name,)); ?>
Try this way
$imghtml=CHtml::image('gallery/'.$data->gallery'.jpg', $data->picturenumber.'.jpg');
echo CHtml::link($imghtml, array('view', 'id'=>$data->id));
Related
I have PHP code that generates HTML code which makes a grid of images. The images are taken from links that are generated for each new image, I also add 133x100 at the end of the image link to resize it on the page. My problem is that a seemingly random selection of images won't display, and I just get a broken image symbol. For example:
This is a link to an image that is generated on my page and is displayed.
This is a link to an image that will not be displayed.
I am only allowed to post 2 links, but removing the %20.%20/133x100 from the end of the last link will show what the picture should be.
Here is the part of the code for the image source:
function display_images(){
//This cycles through each image and displays it as HTML
while($row = $item->fetch()){
Echo "`<img src= '$link[Image_Link] . /133x100' />`"
}
}
It is then called here in a class which puts the images in a grid:
<ul class="rig columns-4">
<?php
display_images();
?>
</ul>
Seemingly about every 2/20 images won't work, and seeing all the links are in the same format, I don't understand why they won't work, and it just seems random.
EDIT: I have noticed that the links that work have 62fx62f at the end of them before the added %20.%20/133x100. If I add it to the raw link in the right place, it makes the image work. But using that generated link, the image still won't load on the page. So using a link with a working image will not work on the page. (This is the same with the raw link without %20.%20/133x100, that links to an image but also won't work on the website)
When visiting the links, the urls look like this:
http://www.example.com/image/randomcharacters%20.%20/133x100
The links work without the %20.%20 at the right dimensions, like so:
http://www.example.com/image/randomcharacters/133x100
This leads me to believe that it may work if you try using the following for the image source instead:
<img src= '$link[Image_Link]/133x100' />
The full code would look like this, for the while function:
while($row = $item->fetch()){
echo "<img src= '" . $link['Image_Link'] . "/133x100' />";
}
I am not aware of steamcommunity much but from the looks of it, i think you should try this.
Instead of putting
. /133x100
Use
/133fx100f
So your URLs would be
while($row = $item->fetch()){
echo "<img src= '" . $link['Image_Link'] . "/133fx100f' />";
}
Just did some trial and error and found out. No explanations for this though!!
How can I make a PHP page that will return image from other server specified by url in variable, like this:
http://www.mypage.com/MyScript.php?src=http://www.otherpage.com/image.png
And after going to that page an image should apear.
It need to work for any other srcs too.
(Why like this?
I want to try bypass the Security Error that apears using toDataUrl from canvas while using image not from the same domain, by using http://www.mypage.com/MyScript.php?src=http://www.otherpage.com/image.png as a image src used in canvas)
You can try with
echo file_get_contents($_GET['src']);
In MyScript.php, use $_GET['src'] as the source of the image
<img src="<? echo $_GET['src']; ?>" />
All other parameters are echoing and the actual URL and the image is NOT displayed in the results page. I need a shortcut that will display the image itself.
Can I simply write:
$page_picture = ______( $some value['image.jpg'] );
So that $page_picture will display the image related to its associated URL?
All suggestions are welcome.
Just do this....
echo "<img src='".$page_picture."'>";
Assuming $page_picture is the url to your image, such as http://www.domain.com/img/blahblah.jpeg
If you wanna also link to the original image, when they click...
echo "<a href='".$page_picture."' target=_blank><img src='".$page_picture."'></a>";
I don't know if anybody's going to know about pretty photo, but it's a image gallery box that opens images in a window like facebook.
http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/
Basically a user will click on a persons profile and it will open a page in this pretty photo box. It is capable of loading images and pages but when i do this i get an error saying "image can not be loaded make sure the path is correct."
I'm trying it with google for now to see if i can get the page to open but it won't even work with google. Does anyone know where i'm going wrong and can anyone show me where to fix this?
<?
echo
"<img width=90px height= 90px src=\"data/photos/{$chat['id']}/_default.jpg\"/>"; ?>
've tried putting the image path in the hyperlink?
<?php
echo "<img width=90px height= 90px src=\"data/photos/{$chat['id']}/_default.jpg\"/>";
?>
Im adding an image to my wordpress theme through dreamweaver cs4 and themedreamer. The image will go in the sidebar.php. When I inserted an image it doesnt shows in firefox and explorer. With safari, the image only shows an empty box with a question sign in the middle.
Is there a special way to add image in a wordpress template?
Prepend below line to images's src:
<?php echo get_bloginfo('template_url'); ?>
Making your src something like this:
<img src="<?php echo get_bloginfo('template_url'); ?>/images/yourimage.gif" alt="" />
No, but you have to get the value of the src attribute correct.