carylson Posted January 2, 2008 Share Posted January 2, 2008 Returns the following error: Parse error: syntax error, unexpected '[', expecting ',' or ';' in /hsphere/local/home/dtsabai/parrecsol.com/cp/index.php on line 47 The Code: <?php include("top.php"); if ($_SESSION['LoggedIn'] != True) { $_SESSION['msg'] = "Please login before accessing your account."; header('Location: login.php'); } if ($_SESSION['AdminLevel'] == "Full") { $SelectorFilter = " WHERE Status = 'Open'"; } else { $SelectorFilter = " WHERE Status = 'Open' AND UserID = ". $_SESSION['ID']; } if ($_REQUEST['fcn'] == "updateinfo") { if ($_REQUEST['frmPassword'] != "" && $_REQUEST['frmEmail'] != "") { $UpdateInfoSQL = "UPDATE Users SET Password = '". $_REQUEST['frmPassword'] ."', Email = '". $_REQUEST['frmEmail'] ."' WHERE ID = ". $_SESSION['ID']; mysql_query($UpdateInfoSQL); $_SESSION['msg'] = "Information updated successfully."; header('Location: index.php'); } else { $_SESSION['msg'] = "Inclomplete form. Please fill out all fields and try again."; header('Location: index.php'); } } $UserInfoSQL = "SELECT * FROM Users WHERE ID = ". $_SESSION['ID']; $UserInfo = mysql_fetch_array(mysql_query($UserInfoSQL)); if (isset($_SESSION['msg'])) { echo "<p align=center><font color=red><strong>". $_SESSION['msg'] ."</strong></font></p>"; $_SESSION['msg'] = ""; } ?> ...A bunch of HTML here... Line 47 snippet below. Line 47: <td width="400px"><?=UserInfo['ID']?></td> This problem is driving me crazy so if anybody has any suggestions it would be greatly appreciated! Aaron Quote Link to comment https://forums.phpfreaks.com/topic/84185-stumped-please-help/ Share on other sites More sharing options...
hitman6003 Posted January 2, 2008 Share Posted January 2, 2008 You don't have a $ in front of the variable. <td width="400px"><?= $UserInfo['ID']?></td> Quote Link to comment https://forums.phpfreaks.com/topic/84185-stumped-please-help/#findComment-428578 Share on other sites More sharing options...
revraz Posted January 2, 2008 Share Posted January 2, 2008 You should also consider using <?php tags instead of <? Quote Link to comment https://forums.phpfreaks.com/topic/84185-stumped-please-help/#findComment-428582 Share on other sites More sharing options...
ohdang888 Posted January 2, 2008 Share Posted January 2, 2008 <?php echo '<td width="400px">'; $WHAT_THIS_IS_SUPPOSED TO TO BE= $UserInfo['ID'] ?> </td> Quote Link to comment https://forums.phpfreaks.com/topic/84185-stumped-please-help/#findComment-428588 Share on other sites More sharing options...
revraz Posted January 2, 2008 Share Posted January 2, 2008 Why? When this works just as good. All he did was use short tags. <td width="400px"><?php echo $UserInfo['ID']?></td> <?php echo '<td width="400px">'; $WHAT_THIS_IS_SUPPOSED TO TO BE= $UserInfo['ID'] ?> </td> Quote Link to comment https://forums.phpfreaks.com/topic/84185-stumped-please-help/#findComment-428599 Share on other sites More sharing options...
hitman6003 Posted January 2, 2008 Share Posted January 2, 2008 <?=$variable ?> Is a valid "shortcut" for using <?php echo $variable; ?> See here: http://us.php.net/manual/en/language.basic-syntax.php, example 2. Quote Link to comment https://forums.phpfreaks.com/topic/84185-stumped-please-help/#findComment-428603 Share on other sites More sharing options...
ohdang888 Posted January 2, 2008 Share Posted January 2, 2008 oh... right. hahaha. sorry. i'm in crazy mode with php Quote Link to comment https://forums.phpfreaks.com/topic/84185-stumped-please-help/#findComment-428624 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.