kyleldi Posted June 2, 2008 Share Posted June 2, 2008 Hi All, I'm working on this if statement that basically shows a customer a box for their email address and the option to submit it for inclusion in a contact list if an item is not available. However, when I try to load it in browser it tells me theres a parse error. What have I done wrong? Here's my code. I've done a few statements like this before, but this one seems to be marked up incorrectly. Thanks! <?php if ($row_rs_store['stockstatus']==Yes) { echo '<p>Shopping Cart Content Goes Here. Such as QTY, Add To Cart Button.. etc. This will only show up if the item is declared as in-stock in inventory. This elminates customers purchasing items that you may not have in stock, but keep in mind it is important to update this value often.</p>'; } else { echo '<p>Currently this product is unavailable for purchase. If you would like to be notified when it becomes available, please provide us with your email address below and we will contact you.</p></br><form action="notify/notifyme.php" method="get" enctype="application/x-www-form-urlencoded" name="notify" target="_self"><input name="date" type="hidden" id="date" value="<?php print date("F d, Y"); ?>" /><input name="date" type="hidden" id="date" value="<?php echo ucwords($row_rs_store['name']); ?>" /><input name="email" type="text" size="25" /><input name="submit" type="button" value="Submit" /></form>'; }?> Link to comment https://forums.phpfreaks.com/topic/108365-solved-php-if-statement-question/ Share on other sites More sharing options...
kenrbnsn Posted June 2, 2008 Share Posted June 2, 2008 All strings must be quoted. You forgot a few quotes. <?php if ($row_rs_store['stockstatus']=='Yes') { echo '<p>Shopping Cart Content Goes Here. Such as QTY, Add To Cart Button.. etc. This will only show up if the item is declared as in-stock in inventory. This elminates customers purchasing items that you may not have in stock, but keep in mind it is important to update this value often.</p>'; } else { echo '<p>Currently this product is unavailable for purchase. If you would like to be notified when it becomes available, please provide us with your email address below and we will contact you.</p></br><form action="notify/notifyme.php" method="get" enctype="application/x-www-form-urlencoded" name="notify" target="_self"><input name="date" type="hidden" id="date" value="' . date("F d, Y") .'" /><input name="date" type="hidden" id="date" value="' . ucwords($row_rs_store['name']) .'" /><input name="email" type="text" size="25" /><input name="submit" type="button" value="Submit" /></form>'; }?> Ken Link to comment https://forums.phpfreaks.com/topic/108365-solved-php-if-statement-question/#findComment-555537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.