Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

External address buttons & https

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-19-2004, 04:05 PM
 
Ian Ian is offline
 

Senior Member
  
Join Date: Sep 2002
Location: Adelaide, South Australia
Posts: 127
 

Default External address buttons & https

I may be having a dunmb moment here but can anyone help me with this problem please.

I have a couple of buttons that are linked to a "Top 50" listing site and of course they cause a problem when my site visitor switches over to the https address as they aren't directly from my site. Is there a way I can say something in the code like if using the secure address, don't show?

I have search around the forum but drawn a blank, any help would be much appriciated.

Thanks
Ian
__________________
_____________________________________

4.6.6 Gold Plus
and 4.7.4 Gold
MySQL server 5.6.29
PHP 5.5.34
Reply With Quote
  #2  
Old 05-19-2004, 04:19 PM
 
Mod King Mod King is offline
 

Senior Member
  
Join Date: May 2004
Posts: 115
 

Default

Code:
{literal} <SCRIPT> var url = document.URL; var re = /^https/; if ( !url.match(re) ) { document.write("<A HREF=\"http://www.somesite.com/index.php\">Some link</a>"); }; </SCRIPT> {/literal}

Try that and let me know how it goes
__________________
Mod King
Reply With Quote
  #3  
Old 05-19-2004, 06:22 PM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

The best way to do this is to check the port on the back end and write the URL based on the port. Using Javascript is not reliable across all browsers.

Here is an example using one of the links you have on your site...


Code:
<a href="http://www.ausscrapcentral.com.au/aschot50/in.php?id=27"> {if $smarty.server.SERVER_PORT == 443} [img]https://www.ausscrapcentral.com.au/aschot50/button.php?id=27[/img] {else} [img]http://www.ausscrapcentral.com.au/aschot50/button.php?id=27[/img] {/if} </a>
Reply With Quote
  #4  
Old 05-19-2004, 07:33 PM
 
Ian Ian is offline
 

Senior Member
  
Join Date: Sep 2002
Location: Adelaide, South Australia
Posts: 127
 

Default

Thanks for the reply
I have been out but I will try it later and let you know, I'm sure there are a lot of sites that could use a fix like this.

All the best
Ian
__________________
_____________________________________

4.6.6 Gold Plus
and 4.7.4 Gold
MySQL server 5.6.29
PHP 5.5.34
Reply With Quote
  #5  
Old 05-19-2004, 08:21 PM
 
Ian Ian is offline
 

Senior Member
  
Join Date: Sep 2002
Location: Adelaide, South Australia
Posts: 127
 

Default

It's all good news!

The provider of the buttons didn't have a https address so, I saved a copy of the button to my server in the images directory. This is the cade I used in the end

Code:
<a href="http://www.ausscrapcentral.com.au/aschot50/in.php?id=27"> {if $smarty.server.SERVER_PORT == 443} [img]{$ImagesDir}/top20.jpg[/img] {else} [img]http://www.ausscrapcentral.com.au/aschot50/button.php?id=27[/img] {/if} </a>

Thanks for all of your help its solved the problem perfectly.

Ian
Very Happy
__________________
_____________________________________

4.6.6 Gold Plus
and 4.7.4 Gold
MySQL server 5.6.29
PHP 5.5.34
Reply With Quote
  #6  
Old 05-20-2004, 01:10 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

http://forum.x-cart.com/viewtopic.php?t=3811&highlight=https

theres a good link for you
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #7  
Old 05-20-2004, 02:28 PM
 
Ian Ian is offline
 

Senior Member
  
Join Date: Sep 2002
Location: Adelaide, South Australia
Posts: 127
 

Default

Thanks Shan it's all been a big help.

I went for displaying a copy of the image from my site when https is in effect as most of the time people are busy checking out at that stage. I made an image with no ranking number on it for that purpose. The live image comes in fine when in http so everyone is happy

Thanks again

Ian
__________________
_____________________________________

4.6.6 Gold Plus
and 4.7.4 Gold
MySQL server 5.6.29
PHP 5.5.34
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:57 PM.

   

 
X-Cart forums © 2001-2020