Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Code for Hiding Images on https-pages


kitchenniche

Recommended Posts

Hi there,

 

I have 2 images in my footer (my site's Store ) which cause the "there are both secure and non-secure items on this page" message when using IE. I know there is a code with which you can hide these images using an IF statement. The code is something like this:

 

if ($HTTPS=='on') {

// do nothing

} else {

// put code here

}

 

I tried it with the codes of my 2 images but I didn't work out.

 

The codes for those images (in footer.php) are:

 

 ?>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="footer">
<td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>



 </tr>
</table>
<br>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
 <td width="50"></td>
[b] <td valign="top"><img src="images/visamasterpaypal.JPG"></td>[/b]
<td align="center" class="smallText">
<?php

 

and

 

echo FOOTER_TEXT_BODY

?>
</td>
[b]<td valign="top"><img src="images/ssl_logo.jpg"></td>[/b]
 <td width="50"></td>
 </tr>
</table>

	</td>
   </tr>
  </table>
  </td>
 </tr>
</table>
</td>
  </tr>
 </table>

<?php

 

If there is someone who could insert the IF statement in these codes that be REALLY great :)

 

PS: I searched the forums for almost 2 hours and all I got is the above IF-statement but I was not able to get it work...

 

Thanks so much :thumbsup:

HIM - Dark Light - Out on 26/09/05
Link to comment
Share on other sites

I use this one:

		if ($request_type != 'SSL') {
	  echo '<a href="http://www.yourdomain.com"> <img src="http://www.mydomain.com" alt="best alt tag ever" border=0></a>';
  }

 

That way it will only show up if it's not SSL.

 

-jared

Link to comment
Share on other sites

I use this one:
		if ($request_type != 'SSL') {
	  echo '<a href="http://www.yourdomain.com"> <img src="http://www.mydomain.com" alt="best alt tag ever" border=0></a>';
  }

 

That way it will only show up if it's not SSL.

 

-jared

 

Hi Jared,

 

Thanks a lot for the above code. I couldn't get it to work though. Unfortunately my knowledge about php is around zero. Is there anyone who could implement this code into my codes above? :sweating:

 

Thanks,

 

Sandra

HIM - Dark Light - Out on 26/09/05
Link to comment
Share on other sites

Use the standard TEP functions, it's what they're there for.

 

<td valign="top">' . tep_image(DIR_WS_IMAGES . 'visamasterpaypal.jpg', $alt = 'mastercard', $width = '', $height = '', $params = '') . '</td>

 

 

<td valign="top">' . tep_image(DIR_WS_IMAGES . 'ssl_logo.jpg', $alt = 'ssl logo', $width = '', $height = '', $params = '') . '</td>

Link to comment
Share on other sites

Use the standard TEP functions, it's what they're there for.

 

<td valign="top">' . tep_image(DIR_WS_IMAGES . 'visamasterpaypal.jpg', $alt = 'mastercard', $width = '', $height = '', $params = '') . '</td>

<td valign="top">' . tep_image(DIR_WS_IMAGES . 'ssl_logo.jpg', $alt = 'ssl logo', $width = '', $height = '', $params = '') . '</td>

 

Hi, thanks for your reply. I did that:

 

 <tr>
<td valign="top">' . tep_image(DIR_WS_IMAGES . 'visamasterpaypal.jpg', $alt = 'mastercard', $width = '50', $height = '', $params = '') . '</td>
<td align="center" class="smallText">

 

I gotten an error though. Is there something wrong with the above code?

 

Thanks a lot

 

Sandra

HIM - Dark Light - Out on 26/09/05
Link to comment
Share on other sites

Link to comment
Share on other sites

or try the TDs like the following :-

 

 

<?
echo '
<td valign="top">' . tep_image(DIR_WS_IMAGES . 'visamasterpaypal.jpg', $alt = 'mastercard', $width = '50', $height = '', $params = '') . '</td>';
?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...