I have two files, one with HTML code when I've diferent photo albums links, example:
<a href="albumprueba.php"><img class="fancyboxi"
src="Libro Fez/Libro Fez - 001.jpg" alt="image19"
width="91%" height="56" /></a>
And another file (is php) I've a routine that scans all the photos in a folder, and shows photos:
<a class="fancyboxi" data-fancybox-group="gallery" title="Laurea"
href="Libro Fez/<?php echo $archivos[$imagen_a_empezar]?>"><img
src="Libro Fez/<?php echo $archivos[$imagen_a_empezar]?>" alt="" width="19%"/></a>
I would like to open the HTML file from an album and open a fancybox with all the photos that showing the routine in PHP file.
I've tried to do in the HTML file this, but doesn't works:
<img src="Libro Fez/Libro Fez - 001.jpg" alt="image19" width="91%" height="56" />
Any idea? thank.
Your href is certainly malformed.
albumprueba.php?Libro Fez/Libro Fez - 001.jpg
That isn't an address as URLs cannot have spaces (go to it manually and check what the address is in the navigation bar in your browser). Moreover it's just landing on a jpeg - are you sure you want this link to be to a single image?
Other than that the anchor should work. Are you getting a 404 error after following the link? If you want the other html file to be perptually viewable from the parent page you should consider using an iframe.
Related
I have a photo gallery, after a click on the thumbnail I want to open image but not file but another php page with this certain photo and some other stuff, how can I give link attributes that php can use from the link?
When you ask something here, you need to explain more about your doubt and share some of the code. I don't know about the context but if you need to generate a link from an image to PHP file with parameters, you can send parameters GET and put the image in the link tag.
<a href="your_php_page.php?param1=something¶m2=something">
<img border="0" alt="Description" src="thumbnail.jpg" width="100" height="100">
</a>
your_php_page.php
<?php
(isset($_GET['param1']))? $param1 = $_GET['param1'] : $param1 = null;
?>
More about GET parameters:
https://www.geeksforgeeks.org/how-to-get-parameters-from-a-url-string-in-php/
https://www.php.net/manual/en/reserved.variables.get.php
I have started learning html and php. I know very little coding of it. I am confused for using png icons in my action buttons. I have currently text button with css. I want use png icons instead that text buttons. I have used it like below
<td>
Edit
Activate
Delete
</td>
Now I want use png icons there instead of text. What should I do for it ?
I have icons located in directory called icons.
Sorry for my little knowledge.
Thanks
You can add icon as image in your code, check below snippet
<td><img src="https://dummyimage.com/20x20/000/fff.png&text=E" alt="Edit"/>
<img src="https://dummyimage.com/20x20/000/fff.png&text=A" alt="Activate"/>
<img src="https://dummyimage.com/20x20/000/fff.png&text=D" alt="Delete"/></td>
It depends on the structure of your web folder, where icons directory is in your web folder.
If you have icon directory in your root folder and php file is also in root then you can simply use below syntax :
<img src="icon/image_name.jpg" alt="" />
Or you can use complete path for icon folder relative to your website url as shown below :
<img src="http://localhost:8080/websitename/icon/image_name.jpg" alt="" />
how can i set image url in page ?
In image you can see I have tried by three ways but it not work.
Images are located under image folder of active theme.
You have three image tags all pointing to different urls of which two appear malformed.
The middle image tag in your screenshot seems the most accurate but you may want to add a semicolon after the right paranthesis.
If all three files are supposed to refer to the same image, then replace the first and last image tags with the middle one.
Then if it still doesnt work then replace bloginfo('template_directory') with the actual location to the images relative to document root on the server but put the value in quotes. For example, if your images are in the subfolder images in folder imageset on your site, then you could use
"http://www.whatever.com/imageset/images" or "/imageset/images".
which results in the code:
<img src="<?php echo "/imageset/images"; ?>/images/banner1.jpg" alt="">
or even better:
<img src="/imageset/images/images/banner1.jpg" alt="">
Try as follows <img src="../images/banner1.jpg" alt="">
I have img tag in my view file (yii frame work). and image is displayed in most of the times. some times the images are not displaying. when I inspect the element, then it shows the img path as src="hhhh://localhost/projects/aaa/images/sample-img-left.png". here for http://, hhhh:// comes. Iam not getting any idea with how this hhhh comes. help me please
You can call Yii::app()->request->baseUrl to get the location where your project resides, then append it with the image path.
For Eg.
<img src="<?php echo Yii::app()->request->baseUrl."/images/sample-img-left.png" ?>" />
why does the images from my site http://allbusters.in doesn't load in other sites like http://jsfiddle.net or http://jsbin.com
Here is the JSBin Link to the check. it shows an image from another site which loads perfectly
http://jsbin.com/afahec
There is no such thing as </img>.
Remove it and properly close the <img tag with a />, then your image appears:
<img src='http://www.lantiis.com/images/top.png' />
<img src='http://allbusters.in/wp-content/uploads/2011/07/facebook_32.png' />
http://jsbin.com/otayuy/
Why?
Because non-compliant code is unpredictable.