Guest Posted December 11, 2004 Posted December 11, 2004 I am trying to enter the following javascript code in the header for a friend but it is just not working right. Can someone here please tell me where I am going wrong. Heres the complete header <?php /* $Id: header.php,v 1.1.1.1 2004/03/04 23:42:24 ccwjr Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ define('DIR_WS_TEMPLATE_IMAGES', 'templates/Original/images/'); // WebMakers.com Added: Down for Maintenance // Hide header if not to show if (DOWN_FOR_MAINTENANCE_HEADER_OFF =='false') { if (SITE_WIDTH!='100%') { ?> <table width="100%" cellpadding="10" cellspacing="0" border="0"> <tr> <td> <tr><td BORDERCOLOR="FF0000"><tr> <td> <?php } ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td colspan="2" valign="middle"><?php if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') ) {?> <script language="javascript"> document.write("<a href= http://banners.linkbuddies.com/click.php?id=232331 img src=http://banners.linkbuddies.com/image.php?id=232331&ref= + document.referrer + "' width=468 height=60 alt= Click Here border=0></a>); </script> <noscript> <a href= http://banners.linkbuddies.com/click.php?id=232331> <img src= http://banners.linkbuddies.com/image.php?id=232331 width=468 height=60 alt= Click Here border=0</a> </noscript> <? } ?> </td> </tr> <tr class="header"> <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_TEMPLATE_IMAGES . 'logo.gif', 'Store Logo') . '</a>'; ?></td> <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="1"> <tr class="headerNavigation"> <td class="headerNavigation"> <?php echo $breadcrumb->trail(' » '); ?></td> <td align="right" class="headerNavigation"> <?php if (!tep_session_is_registered('noaccount')){// DDB - PWA - 040622 - no display of logoff for PWA customers if (!tep_session_is_registered('customer_id')) { echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGIN) . '">' . HEADER_TITLE_LOGIN . '</a> | '; } else { echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_ACCOUNT) . '">' . HEADER_TITLE_MY_ACCOUNT . ' </a> | '; echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF) . '">' . HEADER_TITLE_LOGOFF . ' </a> | '; } } if (tep_session_is_registered('noaccount')) // DDB - PWA - 040622 - no display of account for PWA customers { if (!tep_session_is_registered('customer_id')) { echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOIN, "", "SSL") . '">' . HEADER_TITLE_LOGIN . ' </a> | '; }else{ echo ' <a class="headerNavigation" href="' . tep_href_link(FILENAME_LOGOFF, "", "SSL") . '">' . HEADER_TITLE_LOGOFF . ' </a> | '; } } ?> <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> | <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?> | </a></td> </tr> </table> <?php } ?> <!-- header_eof //--> The part I am entering is if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') ) {?> <script language="javascript"> document.write("<a href= http://banners.linkbuddies.com/click.php?id=232331 img src=http://banners.linkbuddies.com/image.php?id=232331&ref= + document.referrer + "' width=468 height=60 alt= Click Here border=0></a>); </script> <noscript> <a href= http://banners.linkbuddies.com/click.php?id=232331> <img src= http://banners.linkbuddies.com/image.php?id=232331 width=468 height=60 alt= Click Here border=0</a> </noscript> This is not working. I am trying to make this not show up on ssl pages. This part is working so far. But Only a part of code (the part with the link) is showing up on the non ssl pages. The banner images are not showing. Please help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.