Reaper0167 Posted January 4, 2009 Share Posted January 4, 2009 i bought a book the other day about php and mysql. it gives you a demonstration login/register script. i wanted to check it out on screen and not in the book so I took the code from the book and put it on my screen. PHP Designer 08 is giving me an error the commented line below, saying unexpected t string..... I thought i fixed it before but i didn't. do you see what is wrong???? <?php if (isset($message_2)) { echo "<p class='errors'>$message_2</p>\n"; } foreach ($fields_2 as $field => $value) { if ($field == "state") { echo "<div id='field'> <label for='$field'>$value</label> <select name='state' id='state'>; $stateName=getStateName(); $stateCode=getStateCode(); for ($n=1;$n<=50;$n++) { $state=$stateName[$n]; $scode=$stateCode{$n}; echo "<option value='$scode'"; //this line has the error if ($scode== "AL") echo "selected"; echo ">$state</option>\n"; } echo "</select></div>"; } else { if(preg_match(" / pass / i",$field)) $type = "password"; else $type = "text"; echo " < div id = 'field' > <label for = '$field'> $value </label> <input id = '$field'name = '$field'type = '$type'value = '".@$$field."'size = '40'maxlength = '65' / > < div > \n"; } } ?> Link to comment https://forums.phpfreaks.com/topic/139404-solved-do-you-see-the-error/ Share on other sites More sharing options...
corbin Posted January 4, 2009 Share Posted January 4, 2009 Your first echo statement never terminates. Link to comment https://forums.phpfreaks.com/topic/139404-solved-do-you-see-the-error/#findComment-729194 Share on other sites More sharing options...
bubbasheeko Posted January 4, 2009 Share Posted January 4, 2009 echo "<div id='field'> <label for='$field'>$value</label> <select name='state' id='state'>; Should be: echo "<div id='field'> <label for='$field'>$value</label> <select name='state' id='state'>"; Link to comment https://forums.phpfreaks.com/topic/139404-solved-do-you-see-the-error/#findComment-729196 Share on other sites More sharing options...
Reaper0167 Posted January 4, 2009 Author Share Posted January 4, 2009 thanks corbin and bubba,,, pre c ate it Link to comment https://forums.phpfreaks.com/topic/139404-solved-do-you-see-the-error/#findComment-729204 Share on other sites More sharing options...
bubbasheeko Posted January 4, 2009 Share Posted January 4, 2009 No problem Link to comment https://forums.phpfreaks.com/topic/139404-solved-do-you-see-the-error/#findComment-729212 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.