luigicosta Posted August 2, 2012 Share Posted August 2, 2012 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> Link to comment Share on other sites More sharing options...
multimixer Posted August 2, 2012 Share Posted August 2, 2012 if (condition) { do this } else { do that } My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
luigicosta Posted August 2, 2012 Author Share Posted August 2, 2012 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 } ?> Link to comment Share on other sites More sharing options...
multimixer Posted August 2, 2012 Share Posted August 2, 2012 What don't work exactly? My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
luigicosta Posted August 2, 2012 Author Share Posted August 2, 2012 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> Link to comment Share on other sites More sharing options...
multimixer Posted August 2, 2012 Share Posted August 2, 2012 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 ; } ?> My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
luigicosta Posted August 2, 2012 Author Share Posted August 2, 2012 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...... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.