Jump to content

[SOLVED] do you see the error ???


Reaper0167

Recommended Posts

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

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'>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.