Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

just a little lost


mwstinson

Recommended Posts

i am trying to add some php generated links to my index page.

 

basically I have pictures for the categories of products on mysite that are shown on the index page. However just putting simple links in logs a customer out if they click on the link. so what I did is defined new filenames:

// bof products index links
define('FILENAME_S100', 'index.php?cPath=26');
define('FILENAME_S150', 'index.php?cPath=27');
define('FILENAME_S200', 'index.php?cPath=23');
define('FILENAME_S250', 'index.php?cPath=22');
define('FILENAME_S300', 'index.php?cPath=28');
define('FILENAME_S350', 'index.php?cPath=32');
define('FILENAME_S400', 'index.php?cPath=21');
define('FILENAME_S500', 'index.php?cPath=30');
define('FILENAME_S550', 'index.php?cPath=29');
define('FILENAME_SHIRTS', 'index.php?cPath=25');
define('FILENAME_CAPS', 'index.php?cPath=31');
// eof products index links

 

and what I want to use as links is

 

<a href="<?php echo tep_href_link(FILENAME_S150); ?>"><img src="../images/s150main.jpg" width="140" height="140" border="0" /></a>

and so on.

 

but the browser is not translating the code correctly. I am sure it is a syntax problem. However I only know a little about php syntax.

 

If anyone could give me a pointer it would be greatly appreciated.

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

I guess that it is also important that I state that one of the main reasons I am haveing problems is that this is from a language file. I know that this works in a normal php page because i use something like it in the header of another site I built.

 

define('TEXT_MAIN', '
 <table width="95%" border="1" align="center" bordercolor="#FF3399">
<tr>
  <td bordercolor="#FF3399" bgcolor="#333333"><p align="center" class="style1 style2">WHOLESALE ONLY<br />
	MANUFACTURERS OF IRON-ON  RHINESTONE MOTIFS</p>
	<p align="center" class="style2">CHECK OUT HOT NEW PRODUCTS FREQUENTLY,THERE WILL BE NEW MOTIFS ADDED OFTEN</p>
	<p align="center" class="style2">FREE MOTIF WITH EVERY ORDER!!</p>
	<div align="center">
	  <p class="style2">Retailers, do you  want to be added to our retail page so buyers can shop with you? Just email us  your info,  you must be a current customer.</p>

	  <table width="100%" border="0" align="center">
		<tr>
		  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_S100); ?>"><img src="../images/s100main.jpg" width="140" height="140" border="0" /></a></div></td>
		  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_S150); ?>"><img src="../images/s150main.jpg" width="140" height="140" border="0" /></a></div></td>
		  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_S200); ?>"><img src="../images/s200main.jpg" width="140" height="140" border="0" /></a></div></td>
		</tr>
		<tr>
		  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_S250); ?>"><img src="../images/s250main.jpg" width="140" height="140" border="0" /></a></div></td>
		  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_S300); ?>"><img src="../images/s300main.jpg" width="140" height="140" border="0" /></a></div></td>
		  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_S350); ?>"><img src="../images/s350main.gif" width="140" height="140" border="0" /></a></div></td>
		</tr>
		<tr>
		  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_S400); ?>"><img src="../images/s400main.jpg" width="140" height="140" border="0" /></a></div></td>
		  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_S500); ?>"><img src="../images/s500main.gif" width="140" height="140" border="0" /></a></div></td>
		  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_S550); ?>"><img src="../images/s550main.gif" width="140" height="140" border="0" /></a></div></td>
		</tr>
		<tr>
		  <td colspan="3"><table width="99%" border="0">
			<tr>
			  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_SHIRTS); ?>"><img src="../images/shirtmain.jpg" width="140" height="140" border="0" /></a></div></td>
			  <td><div align="center"><a href="<?php echo tep_href_link(FILENAME_CAPS); ?>"><img src="../images/capsmain.gif" width="140" height="140" border="0" /></a></div></td>
			</tr>
		  </table></td>
		</tr>
	  </table>
	  </div></td>
</tr>
 </table>
');

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

ok i think that I figured it out. However it still isnt working. Boo

 

 

The links arent correct.

 

The code

<a href="' . tep_href_link(FILENAME_S100, '', 'NONSSL') . '"><img src="http://mwswebmaster.com/rcprivatelabels/images/s100main.jpg" width="140" height="140" border="0" /></a>

 

creates a link to

rcpl.mwswebmaster.com/index.php?cPath=26?osCsid=7c6f15c96f6f517e9ead32760d6e579d

(incorrect, ?osCsid)

 

and the link in the categories box is:

rcpl.mwswebmaster.com/index.php?cPath=26&osCsid=7c6f15c96f6f517e9ead32760d6e579d

(correct, &osCsid)

 

Does anyone know why this is working on my other site. The only difference that I see is that the osCsid values aren't in the links on the site that it works on.

 

What setting would determine if the osCsid values are listed in the urls?

 

OR

 

how do I change the ? to a & in the links I describe above?

I thought this stuff was gonna be easy!!

BACK IT UP BEFORE YOU JACK IT UP!!!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...