Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Require session in javascript (experts needed)


241

Recommended Posts

Help required to put session id osCid= into this javascript so that a new session id is not created when moving out of the link

 

<td>hello 
<script language="JavaScript" type="text/javascript">
var mfsites = [
['index.php?manufacturers_id=6', 'images/manufacturer_canon.gif'],
['index.php?manufacturers_id=4', 'images/manufacturer_fox.gif'],
['index.php?manufacturers_id=8', 'images/manufacturer_gt_interactive.gif'],
['index.php?manufacturers_id=9', 'images/manufacturer_hewlett_packard.gif'],
['index.php?manufacturers_id=5', 'images/manufacturer_logitech.gif'],
['index.php?manufacturers_id=1', 'images/manufacturer_matrox.gif'],
['index.php?manufacturers_id=2', 'images/manufacturer_microsoft.gif'],
['index.php?manufacturers_id=7', 'images/manufacturer_sierra.gif'],
['index.php?manufacturers_id=3', 'images/manufacturer_warner.gif']
];
var mfIe = false;
if( document.all) {
mfIe = true;
}
var mfsitesIndex = 0;
function mfsitesChange() {
var htmlString = '<a target="_self" href="'+mfsites[mfsitesIndex][0]+'"> <img border="0" src="'+mfsites[mfsitesIndex][1]+'"></a>';
if( mfIe) {
document.all.sites.innerHTML = htmlString;
}
else {
document.layers["sites"].document.open();
document.layers["sites"].document.write( htmlString);
document.layers["sites"].document.close();
}
if(mfsitesIndex < mfsites.length - 1)
mfsitesIndex++;
else
mfsitesIndex = 0;
}
setInterval("mfsitesChange()", 5000);
</script>
<div id="sites"></div></td>

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

You can use php within the javascript - call tep_href_link as you normally would to construct a link.

 

Matti

Link to comment
Share on other sites

Thanks Matti I will work on that idea as it may be easier implimented than the method that I am currently using

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Is there a way to simplify this lot down a bit

 

<td>hello again
<script language="JavaScript" type="text/javascript">
var mfsites = [
['<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=6') . '"> <img border="0" src="images/manufacturer_canon.gif"></a>' ?>'],
['<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=4') . '"> <img border="0" src="images/manufacturer_fox.gif"></a>' ?>'],
['<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=8') . '"> <img border="0" src="images/manufacturer_gt_interactive.gif"></a>' ?>'],
['<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=9') . '"> <img border="0" src="images/manufacturer_hewlett_packard.gif"></a>' ?>'],
['<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=5') . '"> <img border="0" src="images/manufacturer_logitech.gif"></a>' ?>'],
['<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=1') . '"> <img border="0" src="images/manufacturer_matrox.gif"></a>' ?>'],
['<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=2') . '"> <img border="0" src="images/manufacturer_microsoft.gif"></a>' ?>'],
['<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=7') . '"> <img border="0" src="images/manufacturer_sierra.gif"></a>' ?>'],
['<?php echo '<a target="_self" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=3') . '"> <img border="0" src="images/manufacturer_warner.gif"></a>' ?>']
];
var mfIe = false;
if( document.all) {
mfIe = true;
}
var mfsitesIndex = 0;
function mfsitesChange() {
var htmlString = mfsites[mfsitesIndex];
if( mfIe) {
document.all.sites.innerHTML = htmlString;
}
else {
document.layers["sites"].document.open();
document.layers["sites"].document.write( htmlString);
document.layers["sites"].document.close();
}
if(mfsitesIndex < mfsites.length - 1)
mfsitesIndex++;
else
mfsitesIndex = 0;
}
setInterval("mfsitesChange()", 5000);
</script>
<div id="sites"></div></td>

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...