Page 1 of 1

How to Display an image on another site Using PHP???

Posted: Mon Dec 14, 2009 9:57 am
by Danielc1234
Hi all. I have this code displaying an image within our cart software.

<img src="<?php echo $this->getSkinUrl('images/creditcard_logos.jpg') ?>" class="creditcard-image" alt="We accept all major credit cards." />

I am trying to figure out how to display an image located on another site, however I need it to be able to work in http and https modes. We are attempting to use another URL to display some of our images to help with page loading times and do not want to use a CDN.

Any help would be greatly appreciated.

Re: How to Display an image on another site Using PHP???

Posted: Mon Dec 14, 2009 1:55 pm
by requinix

Code: Select all

<img src="//example.com/path/to/image.jpg" class="creditcard-image" alt="We accept all major credit cards." />

Re: How to Display an image on another site Using PHP???

Posted: Mon Dec 14, 2009 5:28 pm
by Danielc1234
Thanks! Does that mean that this code will work in http and https modes?

Re: How to Display an image on another site Using PHP???

Posted: Mon Dec 14, 2009 6:43 pm
by requinix
It should.