Jump to content

correct php syntax


ballhogjoni

Recommended Posts

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

<?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

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.