Jump to content

Archived

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

luigicosta

problem with php

Recommended Posts

Hello to all, another little problem, I can not venirmene and out of this problem:

 

if the product is available is written out Verde (green)

if the product is not available should be written out Rosso (Red) and not both red and Green

 

 

ideas??

 

 

thnaks

 

 

	 <td><?php echo IN_STOK ?></td>
	 <td align="center">
 <?php
  if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
  echo TEXT_ROSSO
 ?>

 <?php
  }
  echo TEXT_VERDE
 ?>		 
	 </td>

Share this post


Link to post
Share on other sites

yes but dont work.......

 

<?php
if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
  echo TEXT_ROSSO
} else {
  echo TEXT_VERDE
}
?>  

Share this post


Link to post
Share on other sites

What don't work exactly?

 

Parse error: syntax error, unexpected '}', expecting ',' or ';' in /web/htdocs/www.firstcellular.co.uk/home/product_info.php on line 205

 

 

 

   <tr>
	 <td><?php echo IN_STOK ?></td>
	 <td align="center">

<?php
if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
   echo TEXT_ROSSO
 } else {
   echo TEXT_VERDE
}
?>   

	 </td>
	 <td> </td>		 
    </tr>

Share this post


Link to post
Share on other sites

How about adding a ; after each echo?

 

<?php
if ( $product_info['products_date_available'] > date('Y-m-d H:i:s') ) {
  echo TEXT_ROSSO ;
} else {
  echo TEXT_VERDE ;
}
?>

 

 

 

great great thanks a lot......

Share this post


Link to post
Share on other sites

×