Porkie Posted September 6, 2009 Share Posted September 6, 2009 im confused with an error i get with this code echo '<div id="leftalign">'; echo '<div id="style1">'; echo '[site News]'.' '.'<a href="admin.php">Edit Details</a>'.' '.'<a href="admin.php">Competitions</a>'.' '.'<a href="admin.php">Contact Us</a>';; echo '</div>'; echo '<hr>'; echo '<form method="post" enctype="multipart/form-data">; <br />; Password: <input type="text" name="password" value="<?php echo $stuff['password']; ?>" /><br /><br />; Email: <input type="email" name="email" value="<?php echo $stuff['email']; ?>" /><br /><br />; Membership Type: <select name="type"> <option value="Music Enthusiast">Music Enthusiast</option> <option value="Band Member"<?php if ($stuff['type'] == 'Band Member') { echo ' Selected="selected"'; } ?>>Band Member</option> </select><br /><br />'; Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/myuklive/public_html/test3.php on line 96 line 96 being, Password: <input type="text" name="password" value="<?php echo $stuff['password']; ?>" /><br /><br />; any help is appreciated regards Quote Link to comment Share on other sites More sharing options...
freddyw Posted September 6, 2009 Share Posted September 6, 2009 above line 96 <br />; change to <br /> i think. not 100% sure. if ur starting a new line in php why arent you using \n Quote Link to comment Share on other sites More sharing options...
Porkie Posted September 6, 2009 Author Share Posted September 6, 2009 nah still isnt right , same error Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted September 6, 2009 Share Posted September 6, 2009 You cannot place PHP tags within an echo statement echo '<form method="post" enctype="multipart/form-data">; <br />; Password: <input type="text" name="password" value="<?php echo $stuff['password']; ?>" /><br /><br />; Email: <input type="email" name="email" value="<?php echo $stuff['email']; ?>" /><br /><br />; Membership Type: <select name="type"> <option value="Music Enthusiast">Music Enthusiast</option> <option value="Band Member"<?php if ($stuff['type'] == 'Band Member') { echo ' Selected="selected"'; } ?>>Band Member</option> </select><br /><br />'; The above should be coded as echo '<form method="post" enctype="multipart/form-data">; <br />; Password: <input type="text" name="password" value="' . $stuff['password'] . '" /><br /><br />; Email: <input type="email" name="email" value="' . $stuff['email'] . '" /><br /><br />; Membership Type: <select name="type"> <option value="Music Enthusiast">Music Enthusiast</option> <option value="Band Member"' . (($stuff['type'] == 'Band Member') ? ' Selected="selected"' : null) . '>Band Member</option> </select><br /><br />'; Quote Link to comment Share on other sites More sharing options...
peranha Posted September 6, 2009 Share Posted September 6, 2009 echo '<form method="post" enctype="multipart/form-data">; <br />; Should be echo '<form method="post" enctype="multipart/form-data"> <br />'; You really need to check that code over. Are you meaning to exit out of php after line 94? if so you will need to change all lines afterwards as HTML does not use ; to close. Quote Link to comment 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.