Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need a help in php code


shasidi

Recommended Posts

Hi everyone

 

I am using some modification of oscommerce.

 

I need a small help in php code below:

 

<?php

if ($banner = tep_banner_exists('dynamic', 'top_3')) {

?>

 

<?php echo tep_display_banner('static', $banner); ?>

 

<?php

}

 

this code is for showing banners, works fine when it is in header.php page, but now I need to put it to the new_products.php when I put it, it doesn't work I think there is a problem of php syntax here. Should I change something here in syntax?

 

Could you help me to solve this problem?

 

Best regards,

Link to comment
Share on other sites

Hi everyone

 

I am using some modification of oscommerce.

 

I need a small help in php code below:

 

<?php

if ($banner = tep_banner_exists('dynamic', 'top_3')) {

?>

 

<?php echo tep_display_banner('static', $banner); ?>

 

<?php

}

 

this code is for showing banners, works fine when it is in header.php page, but now I need to put it to the new_products.php when I put it, it doesn't work I think there is a problem of php syntax here. Should I change something here in syntax?

 

Could you help me to solve this problem?

 

Best regards,

 

It looks like you just need to add a ?> at the end to close the final php tag.

Link to comment
Share on other sites

It looks like you just need to add a ?> at the end to close the final php tag.

 

Actually I have used with that tag also, but still doesn't work

 

I should put this code:

 

<?php

if ($banner = tep_banner_exists('dynamic', 'top_1')) {

?>

 

<?php echo tep_display_banner('static', $banner); ?>

 

<?php

}

?>

 

 

instead of this block of the code(red bold):

 

echo '

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr><td height="5"></td></tr>

<tr>

<a href="' . tep_href_link(FILENAME_SPECIALS) . '">' .

tep_image(DIR_WS_IMAGES . 'm13.jpg', 'KOSMETIK', '281', '226', 'border=0') .

tep_image(DIR_WS_IMAGES . 'm14.jpg', 'KOSMETIK', '245', '226', 'border=0') .

'</a>

</td>

</tr>

<tr><td class="brand"></td></tr>

</table>

 

I am sure it should be some small fix in syntax and everything will work fine, may be someone knows that.

Link to comment
Share on other sites

echo '
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height="5"></td></tr>
<tr>';
if ($banner = tep_banner_exists('dynamic', 'top_1')) {
echo tep_display_banner('static', $banner);
}
echo '
</td>
</tr>
<tr><td class="brand"></td></tr>
</table>

Link to comment
Share on other sites

echo '
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height="5"></td></tr>
<tr>';
if ($banner = tep_banner_exists('dynamic', 'top_1')) {
echo tep_display_banner('static', $banner);
}
echo '
</td>
</tr>
<tr><td class="brand"></td></tr>
</table>

 

Thank you too much again Babygurgles :thumbsup:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...