Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

https and images

$
0
0

Trying to use a variable to build the SRC for an image file when the page is HTTPS.

In the header...

<%
Response.Buffer = True
If (Request.ServerVariables("HTTPS") = "ON") Then
    varHttps = "https://" & Request.ServerVariables("Server_Name")
Else
 varHttps = "http://" & Request.ServerVariables("Server_Name")
End if
%>

... in the body...

<img src="<%=varHttps%>/images/header.jpg" mce_src="<%=varHttps%>/images/header.jpg" width="900" height="200" alt="checkout">

..and the results always:

<img src="http://www.mysite.com/images/header.jpg" width="900" height="200" alt="Checkout">

When I'm expecting:

<img src="https://www.mysite.com/images/header.jpg" width="900" height="200" alt="Checkout">

 

What am I doing wrong?

 

thanks!


Viewing all articles
Browse latest Browse all 27852

Trending Articles