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; Quote Link to comment 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; ?> Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.