eva21 Posted August 5, 2008 Share Posted August 5, 2008 Why isnt the following acceptable? echo "<input type=text class=\"textBox\" name=" . $rows4['id'] . "_option1T" value=" . $rows5['option1'] . " readonly> <br>"; Where it says "name=..." thats where it is having the problem, why and how could i make it correct? Link to comment https://forums.phpfreaks.com/topic/118294-getting-an-error-in-my-code/ Share on other sites More sharing options...
wildteen88 Posted August 5, 2008 Share Posted August 5, 2008 You need to escape your quotes echo "<input type=text class=\"textBox\" name=\"" . $rows4['id'] . "_option1T\" value=\"" . $rows5['option1'] . "\" readonly><br />"; Link to comment https://forums.phpfreaks.com/topic/118294-getting-an-error-in-my-code/#findComment-608749 Share on other sites More sharing options...
DarkWater Posted August 5, 2008 Share Posted August 5, 2008 Wow that's sloppy. Try: printf('<input type="text" class="textBox" name="%d_option1T" value="%s" readonly />', $rows4['id'], $rows5['option1']); I also made it valid markup. You forgot some quotation marks around some attributes and the XML-style tag closing. What are you trying to do with this code, by the way? It could probably be neatened up. Link to comment https://forums.phpfreaks.com/topic/118294-getting-an-error-in-my-code/#findComment-608751 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.