ballhogjoni Posted July 12, 2007 Share Posted July 12, 2007 I get this error: Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/realfina/public_html/thediaperbakery/inc/functions.inc.php on line 17 What would be the correct syntax here? This is my code if (isset($_SESSION['started']) && $_SESSION['started'] == 1 || $_SESSION['started'] == 'Boy Cake') { $boy_girl = $_SESSION['started'] => 'Boy Cake'; } elseif (isset($_SESSION['started']) && $_SESSION['started'] !== 1 || $_SESSION['started'] !== 'Boy Cake') { $boy_girl = $_SESSION['started'] => 'Girl Cake'; } elseif (!isset($_SESSION['started'])) { $_SESSION['started'] = $_POST['boyGirl']; } echo $boy_girl; Link to comment https://forums.phpfreaks.com/topic/59574-correct-php-syntax/ Share on other sites More sharing options...
trq Posted July 12, 2007 Share Posted July 12, 2007 <?php if (isset($_SESSION['started']) && $_SESSION['started'] == 1 || $_SESSION['started'] == 'Boy Cake') { $boy_girl = $_SESSION['started']; } elseif (isset($_SESSION['started']) && $_SESSION['started'] != 1 || $_SESSION['started'] != 'Boy Cake') { $boy_girl = $_SESSION['started']; } elseif (!isset($_SESSION['started'])) { $_SESSION['started'] = $_POST['boyGirl']; } echo $boy_girl; ?> Link to comment https://forums.phpfreaks.com/topic/59574-correct-php-syntax/#findComment-296025 Share on other sites More sharing options...
ballhogjoni Posted July 12, 2007 Author Share Posted July 12, 2007 Thorpe will that idea not work, $boy_girl = $_SESSION['started'] => 'Boy Cake'; ? I want to have $boy_girl echo boy cake or girl cake depending on the elseif statement. How can I accomplish this? Link to comment https://forums.phpfreaks.com/topic/59574-correct-php-syntax/#findComment-296030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.