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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Danielc1234
Forum Newbie
Posts: 18
Joined: Tue Jul 29, 2008 11:55 am

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

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

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

Post by requinix »

Code: Select all

<img src="//example.com/path/to/image.jpg" class="creditcard-image" alt="We accept all major credit cards." />
Danielc1234
Forum Newbie
Posts: 18
Joined: Tue Jul 29, 2008 11:55 am

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

Post by Danielc1234 »

Thanks! Does that mean that this code will work in http and https modes?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

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

Post by requinix »

It should.
Post Reply