angelsRock Posted October 13, 2007 Share Posted October 13, 2007 <?php if ( strlen($row[username])>1 ) ?> <input type="text" name="name" size="31" value=<?php echo $row[name];?>> <?php else ?> <input type="text" name="name" size="31" value=<?php if (isset($_POST[name])) echo $_POST[name];?>> the error is on Parse error: syntax error, unexpected T_ELSE in ... why? Quote Link to comment https://forums.phpfreaks.com/topic/73090-error-on-syntax/ Share on other sites More sharing options...
esukf Posted October 13, 2007 Share Posted October 13, 2007 use either <?php if( strlen($row[username])>1 ): ?> <input type="text" name="name" size="31" value=<?php echo $row[name];?>> <?php else: ?> <input type="text" name="name" size="31" value=<?php if (isset($_POST[name])) echo $_POST[name];?>> <?php endif; ?> or <?php if( strlen($row[username])>1 ){ ?> <input type="text" name="name" size="31" value=<?php echo $row[name];?>> <?php } else { ?> <input type="text" name="name" size="31" value=<?php if (isset($_POST[name])) echo $_POST[name];?>> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/73090-error-on-syntax/#findComment-368596 Share on other sites More sharing options...
chocopi Posted October 13, 2007 Share Posted October 13, 2007 Also, shouldnt this: $row[username] be $row['username'] or $row[$username] Theres a bit of discussion in this topic http://www.phpfreaks.com/forums/index.php/topic,163268.msg715688.html#msg715688 Quote Link to comment https://forums.phpfreaks.com/topic/73090-error-on-syntax/#findComment-368612 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.