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 Link to comment https://forums.phpfreaks.com/topic/173327-html-and-php/ 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 Link to comment https://forums.phpfreaks.com/topic/173327-html-and-php/#findComment-913653 Share on other sites More sharing options...
Porkie Posted September 6, 2009 Author Share Posted September 6, 2009 nah still isnt right , same error Link to comment https://forums.phpfreaks.com/topic/173327-html-and-php/#findComment-913690 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 />'; Link to comment https://forums.phpfreaks.com/topic/173327-html-and-php/#findComment-913694 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. Link to comment https://forums.phpfreaks.com/topic/173327-html-and-php/#findComment-913695 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.