pescott Posted January 8, 2008 Share Posted January 8, 2008 Hello all, could use your help on this one: I have a form that needs validation. There is no problem in that, you may see cheks that do not the values of the variables, but that is not so important right now. The problem is the dynamic pulldown menu, which fails to show on the page. When I remove that particular section, the page loads perfectly, so I know the error is in there somewhere. <form action="" method="post"> <tr> <?php //If checkboxes, radio buttons, or drop-down selections have been selected, //this sets them to be pre-selected on the next screen. if (isset($HTTP_POST_VARS["submit1"]) || isset($HTTP_POST_VARS["submit2"])){ $check1=""; $check2=""; $check3=""; $check4=""; $check5=""; $check6=""; $check7=""; $check8=""; $check9=""; $check10=""; $check11=""; $check12=""; $check13=""; $check14=""; $check15=""; $check16=""; if (isset($HTTP_POST_VARS["iagree"])) $check1=" checked"; if (isset($HTTP_POST_VARS["emailme"])) $check2=" checked"; if ($HTTP_POST_VARS["geslacht"]=="vrouw") $check15=" checked"; else $check14=" checked"; if ($HTTP_POST_VARS["beroepsgroep"]=="apothekers") $check3=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="artsen") $check4=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="fysiotherapeuten") $check5=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="gz-psychologen") $check6=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="psychotherapeuten") $check7=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="tandartsen") $check8=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="verloskundigen") $check9=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="verpleegkundigen") $check10=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="student geneeskunde") $check16=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="niet geregistreerd") $check11=" selected"; else $check12=" selected"; } //Final submit page. If all fields are filled out and validate, display. if (isset($HTTP_POST_VARS["submit2"]) && $error==""){ echo"<td> <p>Bedankt voor uw bericht! We nemen zo spoedig mogelijk contact met u op. <strong>$recordcount</strong></p> Klik <a href=\"contact.php\">hier</a> om terug te gaan naar het begin. </td> </tr>"; } //If all fields are not filled out or do not validate, display errors and allow //for correction and resubmittion. else{ echo" <tr> <td id=\"else_td\"> "; if($error!="") echo"<p style=\"color:#ff0000;\">$error</p>"; elseif(isset($HTTP_POST_VARS["submit1"])) echo"<p><strong>Controleert u uw informatie alstublieft voor verzending:</strong></p>"; echo"<table id=\"subtable\"> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Voorletters:</td> <td></td> <td><input tabindex=\"1\" size=\"45\" type=\"text\" name=\"voorletters\" value=\"$voorletters\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Tussenvoegsel:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('Bijv. de, van, van der, etc.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td><input tabindex=\"2\" size=\"45\" type=\"text\" name=\"voorvoegsel\" value=\"$voorvoegsel\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Achternaam:</td> <td></td> <td><input tabindex=\"3\" size=\"45\" type=\"text\" name=\"achternaam\" value=\"$achternaam\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Geslacht:</td> <td></td> <td><input tabindex=\"4\" size=\"30\" type=\"radio\" name=\"geslacht\" value=\"man\" $check14/> Man <input tabindex=\"5\" size=\"30\" type=\"radio\" name=\"geslacht\" value=\"vrouw\" $check15/> Vrouw</td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Straat:</td> <td></td> <td><input tabindex=\"6\" size=\"45\" type=\"text\" name=\"straat\" value=\"$straat\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Huisnummer:</td> <td></td> <td><input tabindex=\"7\" size=\"45\" type=\"text\" name=\"huisnummer\" value=\"$huisnummer\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Huisnummer toevoeging:</td> <td></td> <td><input tabindex=\"8\" size=\"45\" type=\"text\" name=\"toevoeging\" value=\"$toevoeging\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Postcode:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('De postcode vult u in volgens dit sjabloon:<br><b>0000 AA</b>.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td><input tabindex=\"9\" size=\"45\" type=\"text\" name=\"postcode\" value=\"$postcode\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Woonplaats:</td> <td></td> <td><input tabindex=\"10\" size=\"45\" type=\"text\" name=\"woonplaats\" value=\"$woonplaats\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Telefoonnummer:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('Vul in het eerste veld het netnummer in, daarna het abonneenummer.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td><input tabindex=\"11\" size=\"8\" type=\"text\" name=\"netnummer\" value=\"$netnummer\" /> - <input tabindex=\"12\" size=\"29\" type=\"text\" name=\"abonnee\" value=\"$abonnee\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Onderwerp:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('Indien u een vraag hebt over een object uit ons aanbod, maakt u dan een keuze uit de lijst.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td> $sql="SELECT * FROM ‘objects’ ORDER BY ‘straat’ ASC"; if ($result = mysql_query($sql) && mysql_num_rows($result)) { echo "<select tabindex=\"12\" name=\"onderwerp\">"; while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row[id]}\">'".$row["straat"]." ".$row["nummer"].", ".$row["plaatsnaam"]."'</option>"; } echo "</select>"; } echo "</td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />E-mailadres:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('Wanneer u die optie onderaan selecteert, wordt een kopie van uw bericht naar dit e-mailadres gestuurd.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td><input tabindex=\"13\" size=\"45\" type=\"text\" name=\"emailadres\" value=\"$emailadres\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Uw bericht:</td> <td></td> <td><textarea tabindex=\"14\" cols=\"53\" rows=\"7\" name=\"bericht\">".$HTTP_POST_VARS["bericht"]."</textarea></td> </tr> <tr> <td id=\"contd\" colspan=\"3\"><h3 id=\"onderteken\">Verstuur een bericht:</h3> <input tabindex=\"15\" size=\"30\" type=\"checkbox\" name=\"iagree\" value=\"iagree\"$check13> <img src=\"i/cvb01_star_sm.gif\" />Ik ga akkoord met de <a href=\"disclaimer.php\" target=\"_blank\">algemene voorwaarden</a>.<br /> <input tabindex=\"16\" size=\"30\" type=\"checkbox\" name=\"emailme\" value=\"emailme\"$check2> <img src=\"i/cvb01_horizontalspace.gif\" />Stuur mij een bevestigingsbericht. </td> </tr> <tr> <td id=\"submit\" colspan=\"3\">"; if ((isset($HTTP_POST_VARS["submit1"]) && $error!="") || (isset($HTTP_POST_VARS["submit2"]) && $error!="")) echo"<p style=\"color:#ff0000;\">Herstelt u alstublieft de gevonden fouten en verstuurt u de informatie dan nogmaals:<br /> <div align=\"right\"><input tabindex=\"17\" type=\"submit\" value=\"Versturen\" name=\"submit1\"></div></p>"; elseif (isset($HTTP_POST_VARS["submit1"])) echo"<p style=\"font-weight:bold;\">Klopt de bovenstaande informatie? Zo nee, brengt u dan uw wijzigingen aan. Zo ja, klikt u dan op de onderstaande knop om te versturen:<br /> <div align=\"right\"><input tabindex=\"17\" type=\"submit\" value=\"Versturen\" name=\"submit2\"></div></p>"; else echo"<p>Velden gemarkeerd met een <img src=\"i/cvb01_star_sm.gif\" /> zijn verplicht.<br /> <div align=\"right\"><input tabindex=\"17\" type=\"submit\" value=\"Versturen\" name=\"submit1\"> <input tabindex=\"18\" type=\"reset\" value=\"Leegmaken\"></div></p>"; echo "</td> </tr> </table>"; } ?> </td> </tr> </form> The error I receive is this: Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/httpd/vhosts/pescott.nl/subdomains/carelvb/httpdocs/contact.php on line 412 Line 412 is this line: $sql="SELECT * FROM ‘objects’ ORDER BY ‘straat’ ASC"; Any suggestions on how to fix this error? Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/ Share on other sites More sharing options...
Ken2k7 Posted January 8, 2008 Share Posted January 8, 2008 At that point, aren't you still echoing out a string? Try closing it out and then perform that action. Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-433877 Share on other sites More sharing options...
nikefido Posted January 8, 2008 Share Posted January 8, 2008 look above the line the error is reporting on. you didn't close out after the <td> You'll notice that even in your code here, the wrong items are RED - the color used for a string! <td> should be <td>"; Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-433888 Share on other sites More sharing options...
pescott Posted January 8, 2008 Author Share Posted January 8, 2008 I did that before, but then the HTML shows an empty <td></td> <tr> <td id="contd"><img src="i/cvb01_horizontalspace.gif" />Onderwerp:</td> <td><a href="#" class="hintanchor" onMouseover="showhint('Indien u een vraag hebt over een object uit ons aanbod, maakt u dan een keuze uit de lijst.', this, event, '242px')"><img src="i/cvb01_information.gif" /></a></td> <td></td> </tr> <tr> <td id="contd"><img src="i/cvb01_star_sm.gif" />E-mailadres:</td> <td><a href="#" class="hintanchor" onMouseover="showhint('Wanneer u die optie onderaan selecteert, wordt een kopie van uw bericht naar dit e-mailadres gestuurd.', this, event, '242px')"><img src="i/cvb01_information.gif" /></a></td> <td><input tabindex="13" size="45" type="text" name="emailadres" value="" /></td> </tr> So how to generate the correct dynamic pulldown menu? Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-433900 Share on other sites More sharing options...
revraz Posted January 8, 2008 Share Posted January 8, 2008 All they are saying is close the echo before you do the PHP. You are trying to include the PHP in the echo string. Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-433907 Share on other sites More sharing options...
Ken2k7 Posted January 8, 2008 Share Posted January 8, 2008 Are you serious? You can't edit 2 characters in that yourself? nikefido told you what to do. Here: <form action="" method="post"> <tr> <?php //If checkboxes, radio buttons, or drop-down selections have been selected, //this sets them to be pre-selected on the next screen. if (isset($HTTP_POST_VARS["submit1"]) || isset($HTTP_POST_VARS["submit2"])){ $check1=""; $check2=""; $check3=""; $check4=""; $check5=""; $check6=""; $check7=""; $check8=""; $check9=""; $check10=""; $check11=""; $check12=""; $check13=""; $check14=""; $check15=""; $check16=""; if (isset($HTTP_POST_VARS["iagree"])) $check1=" checked"; if (isset($HTTP_POST_VARS["emailme"])) $check2=" checked"; if ($HTTP_POST_VARS["geslacht"]=="vrouw") $check15=" checked"; else $check14=" checked"; if ($HTTP_POST_VARS["beroepsgroep"]=="apothekers") $check3=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="artsen") $check4=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="fysiotherapeuten") $check5=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="gz-psychologen") $check6=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="psychotherapeuten") $check7=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="tandartsen") $check8=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="verloskundigen") $check9=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="verpleegkundigen") $check10=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="student geneeskunde") $check16=" selected"; elseif ($HTTP_POST_VARS["beroepsgroep"]=="niet geregistreerd") $check11=" selected"; else $check12=" selected"; } //Final submit page. If all fields are filled out and validate, display. if (isset($HTTP_POST_VARS["submit2"]) && $error==""){ echo"<td> <p>Bedankt voor uw bericht! We nemen zo spoedig mogelijk contact met u op. <strong>$recordcount</strong></p> Klik <a href=\"contact.php\">hier</a> om terug te gaan naar het begin. </td> </tr>"; } //If all fields are not filled out or do not validate, display errors and allow //for correction and resubmittion. else{ echo" <tr> <td id=\"else_td\"> "; if($error!="") echo"<p style=\"color:#ff0000;\">$error</p>"; elseif(isset($HTTP_POST_VARS["submit1"])) echo"<p><strong>Controleert u uw informatie alstublieft voor verzending:</strong></p>"; echo"<table id=\"subtable\"> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Voorletters:</td> <td></td> <td><input tabindex=\"1\" size=\"45\" type=\"text\" name=\"voorletters\" value=\"$voorletters\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Tussenvoegsel:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('Bijv. de, van, van der, etc.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td><input tabindex=\"2\" size=\"45\" type=\"text\" name=\"voorvoegsel\" value=\"$voorvoegsel\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Achternaam:</td> <td></td> <td><input tabindex=\"3\" size=\"45\" type=\"text\" name=\"achternaam\" value=\"$achternaam\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Geslacht:</td> <td></td> <td><input tabindex=\"4\" size=\"30\" type=\"radio\" name=\"geslacht\" value=\"man\" $check14/> Man <input tabindex=\"5\" size=\"30\" type=\"radio\" name=\"geslacht\" value=\"vrouw\" $check15/> Vrouw</td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Straat:</td> <td></td> <td><input tabindex=\"6\" size=\"45\" type=\"text\" name=\"straat\" value=\"$straat\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Huisnummer:</td> <td></td> <td><input tabindex=\"7\" size=\"45\" type=\"text\" name=\"huisnummer\" value=\"$huisnummer\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Huisnummer toevoeging:</td> <td></td> <td><input tabindex=\"8\" size=\"45\" type=\"text\" name=\"toevoeging\" value=\"$toevoeging\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Postcode:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('De postcode vult u in volgens dit sjabloon:<br><b>0000 AA</b>.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td><input tabindex=\"9\" size=\"45\" type=\"text\" name=\"postcode\" value=\"$postcode\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Woonplaats:</td> <td></td> <td><input tabindex=\"10\" size=\"45\" type=\"text\" name=\"woonplaats\" value=\"$woonplaats\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />Telefoonnummer:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('Vul in het eerste veld het netnummer in, daarna het abonneenummer.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td><input tabindex=\"11\" size=\"8\" type=\"text\" name=\"netnummer\" value=\"$netnummer\" /> - <input tabindex=\"12\" size=\"29\" type=\"text\" name=\"abonnee\" value=\"$abonnee\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Onderwerp:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('Indien u een vraag hebt over een object uit ons aanbod, maakt u dan een keuze uit de lijst.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td>"; $sql="SELECT * FROM ‘objects’ ORDER BY ‘straat’ ASC"; if ($result = mysql_query($sql) && mysql_num_rows($result)) { echo "<select tabindex="12\" name=\"onderwerp\">"; while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row[id]}\">'".$row["straat"]." ".$row["nummer"].", ".$row["plaatsnaam"]."'</option>"; } echo "</select>"; } echo "</td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_star_sm.gif\" />E-mailadres:</td> <td><a href=\"#\" class=\"hintanchor\" onMouseover=\"showhint('Wanneer u die optie onderaan selecteert, wordt een kopie van uw bericht naar dit e-mailadres gestuurd.', this, event, '242px')\"><img src=\"i/cvb01_information.gif\" /></a></td> <td><input tabindex=\"13\" size=\"45\" type=\"text\" name=\"emailadres\" value=\"$emailadres\" /></td> </tr> <tr> <td id=\"contd\"><img src=\"i/cvb01_horizontalspace.gif\" />Uw bericht:</td> <td></td> <td><textarea tabindex=\"14\" cols=\"53\" rows=\"7\" name=\"bericht\">".$HTTP_POST_VARS["bericht"]."</textarea></td> </tr> <tr> <td id=\"contd\" colspan=\"3\"><h3 id=\"onderteken\">Verstuur een bericht:</h3> <input tabindex=\"15\" size=\"30\" type=\"checkbox\" name=\"iagree\" value=\"iagree\"$check13> <img src=\"i/cvb01_star_sm.gif\" />Ik ga akkoord met de <a href=\"disclaimer.php\" target=\"_blank\">algemene voorwaarden</a>.<br /> <input tabindex=\"16\" size=\"30\" type=\"checkbox\" name=\"emailme\" value=\"emailme\"$check2> <img src=\"i/cvb01_horizontalspace.gif\" />Stuur mij een bevestigingsbericht. </td> </tr> <tr> <td id=\"submit\" colspan=\"3\">"; if ((isset($HTTP_POST_VARS["submit1"]) && $error!="") || (isset($HTTP_POST_VARS["submit2"]) && $error!="")) echo"<p style=\"color:#ff0000;\">Herstelt u alstublieft de gevonden fouten en verstuurt u de informatie dan nogmaals:<br /> <div align=\"right\"><input tabindex=\"17\" type=\"submit\" value=\"Versturen\" name=\"submit1\"></div></p>"; elseif (isset($HTTP_POST_VARS["submit1"])) echo"<p style=\"font-weight:bold;\">Klopt de bovenstaande informatie? Zo nee, brengt u dan uw wijzigingen aan. Zo ja, klikt u dan op de onderstaande knop om te versturen:<br /> <div align=\"right\"><input tabindex=\"17\" type=\"submit\" value=\"Versturen\" name=\"submit2\"></div></p>"; else echo"<p>Velden gemarkeerd met een <img src=\"i/cvb01_star_sm.gif\" /> zijn verplicht.<br /> <div align=\"right\"><input tabindex=\"17\" type=\"submit\" value=\"Versturen\" name=\"submit1\"> <input tabindex=\"18\" type=\"reset\" value=\"Leegmaken\"></div></p>"; echo "</td> </tr> </table>"; } ?> </td> </tr> </form> Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-433908 Share on other sites More sharing options...
pescott Posted January 8, 2008 Author Share Posted January 8, 2008 Umm, yeah, Ken2k7, of course I got that. That's how I ended up with the empty <td>. The problem is generating the dynamic pulldown in there. Apparently there is something wrong with that. So, going back to my first post, the menu not showing is my main issue... Suggestiosn greatly appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-433922 Share on other sites More sharing options...
Ken2k7 Posted January 8, 2008 Share Posted January 8, 2008 Oh...sorry So which is the part of the code that generates the dropdown? Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-433932 Share on other sites More sharing options...
pescott Posted January 9, 2008 Author Share Posted January 9, 2008 Ken2k7, That would be this part (or so I hope <td> $sql="SELECT * FROM ‘objects’ ORDER BY ‘straat’ ASC"; if ($result = mysql_query($sql) && mysql_num_rows($result)) { echo "<select tabindex="12\" name=\"onderwerp\">"; while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row[id]}\">'".$row["straat"]." ".$row["nummer"].", ".$row["plaatsnaam"]."'</option>"; } echo "</select>"; } echo "</td> Thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-434316 Share on other sites More sharing options...
Ken2k7 Posted January 9, 2008 Share Posted January 9, 2008 Wait, you didn't replace your code with mine. You still haven't closed out the string. Please do that. Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-434348 Share on other sites More sharing options...
pescott Posted January 9, 2008 Author Share Posted January 9, 2008 True; I selected from this thread in the code above instead of from the altered text editor file Moronic me! <td>"; $sql="SELECT * FROM ‘objects’ ORDER BY ‘straat’ ASC"; if ($result = mysql_query($sql) && mysql_num_rows($result)) { echo "<select tabindex="12\" name=\"onderwerp\">"; while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row[id]}\">'".$row["straat"]." ".$row["nummer"].", ".$row["plaatsnaam"]."'</option>"; } echo "</select>"; } echo "</td> Is the real thing Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-434349 Share on other sites More sharing options...
Ken2k7 Posted January 9, 2008 Share Posted January 9, 2008 Try changing: <td>"; $sql="SELECT * FROM ‘objects’ ORDER BY ‘straat’ ASC"; if ($result = mysql_query($sql) && mysql_num_rows($result)) { echo "<select tabindex="12\" name=\"onderwerp\">"; while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row[id]}\">'".$row["straat"]." ".$row["nummer"].", ".$row["plaatsnaam"]."'</option>"; } echo "</select>"; } echo "</td> To this: <td>"; $sql="SELECT * FROM objects ORDER BY straat ASC"; $result = mysql_query($sql) or die(mysql_error()); if ($result && mysql_num_rows($result)) { echo "<select tabindex="12\" name=\"onderwerp\">"; while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row['id']}\">'".$row["straat"]." ".$row["nummer"].", ".$row["plaatsnaam"]."'</option>"; } echo "</select>"; } echo "</td> Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-434352 Share on other sites More sharing options...
pescott Posted January 9, 2008 Author Share Posted January 9, 2008 The problem was in the accidental deletion of a crucial line... THANKS A LOT FOR THE HELP! Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-434841 Share on other sites More sharing options...
revraz Posted January 9, 2008 Share Posted January 9, 2008 Mark as solved please Quote Link to comment https://forums.phpfreaks.com/topic/85076-solved-unexpected-t_string-expecting-or-in-a-form/#findComment-434932 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.