Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

css problem send data


mdwalter

Recommended Posts

Hello guy!!

I'm sorry for my english.

I make very simple code php for change stylesheet.css, stylesheet-red.css, stylesheet-blu.css, stylesheet-gray.css. This is the code:

catalog/index.php, product_info.php, advance_search.php, shoping_cart.php etc...

 

I raplace this:

<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

with this:

<?

$css=$_GET["css"];

if ($css=="")

{

 

?>

<link href="stylesheet.css" type="text/css" rel="stylesheet" />

<? }

else

{

?>

<link href="<? echo $css;?>" type="text/css" rel="stylesheet" />

<? } ?>

 

 

then I put this code for show and chooice the color in some place the index.php:

 

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

<tr>

<td colspan="2" class="pageHeading"> <table align="right"><tr>

<? if ($css=="stylesheet-rosso.css")

{

?>

<td><a href="index.php?css=stylesheet.css"><img src="square-green.JPG" alt="green" /></a></td>

<? }

else

{

?>

<td><a href="index.php?css=stylesheet-rosso.css"><img src="square-red.JPG" alt="red" /></a></td>

<? } ?>

<? if ($css=="stylesheet-blu.css")

{

?>

<td><a href="index.php?css=stylesheet.css"><img src="square-green.JPG" alt="green" /></a></td>

<? }

else

{

?>

<td><a href="index.php?css=stylesheet-blu.css"><img src="square-blu.JPG" alt="blu" /></a></td>

<? } ?>

<? if ($css=="stylesheet-gray.css")

{

?>

<td><a href="index.php?css=stylesheet.css"><img src="square-green.JPG" alt="green" /></a></td>

<? }

else

{

?>

<td><a href="index.php?css=stylesheet-gray.css"><img src="square-gray.JPG" alt="gray" /></a></td>

 

<? } ?>

</tr>

</table>

 

in index.php all is good, but in another files not have change. When I click in some link the css file change in default css file.

How I can send the variable css in every page? becouse the index.php have the subpage.

Thank you!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...