Forum Moderators: coopster

Message Too Old, No Replies

Why am I getting an unexpected string error

         

dc_duo

5:14 pm on Oct 15, 2004 (gmt 0)

10+ Year Member



Ive tried else ifs and god knows why I cant get this to work I need to write a script for 5 log ins and passwords they have to be manually set up.

I am always getting a parse error when using an if and I do not know why please help.

<?
// Start Output Buffering
ob_start();
?>


<?php // Script 11.6 - register.php

//Address error handling
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// Check user log ins and display relevant links

Session_Start();

// The Owls

if (isset ($_SESSION['username'])) {

if ($_SESSION['username'] == owlschc) {

echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="50%"><p><font color="#fffff">Welcome back <b>' .ucfirst($_SESSION['username']). '</b> what would you like to do?. </font></td>
<td width="50%"><a href="editteam.php?id=Mickey mouse Team">Edit Owls Team News & Match Reports</a> - <a href="playerlist.php?id=owls">Edit Player Details</a> - <a href="addaplayer.php">Add New Player</a></td>
</tr>
</table>';
}

if ($_SESSION['username'] == 1stchc) {

echo '<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="50%"><p><font color="#fffff">Welcome back <b>' .ucfirst($_SESSION['username']). '</b> what would you like to do?. </font></td>
<td width="50%"><a href="editteam.php?id=1st Xi">Edit Owls Team News & Match Reports</a> - <a href="playerlist.php?id=1st Xi">Edit Player Details</a> - <a href="addaplayer.php">Add New Player</a></td>
</tr>
</table>';
}


} // End of Session Isset if

?>

mincklerstraat

5:24 pm on Oct 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if ($_SESSION['username'] == 'owlschc') {

if ($_SESSION['username'] == '1stchc') {

Replace lines looking like above with lines above. That said:

a) get an editor with line numbers so you can see which line it is, and just post that line of code, and maybe a tiny little bit above it
b) check the charter and the link on posting code, it's got hints on getting good help here

cheers and happy coding