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? 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 } ?> 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 Link to comment https://forums.phpfreaks.com/topic/73090-error-on-syntax/#findComment-368612 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.