On Mon, 3 Feb 2003, Sunfire wrote: > do this: > run your php query to get the value of the text box and then do this: > <?php > //connect to db here > $query=//put your query here > while($foo=mysql_fetch_array($query)){ > //if you use mysql that is... > echo "<input type=text name=YourVarName value=\"$foo\">"; > } > ?>
No offense Sunfire but I don't think you're ready to be answering questions. Please spend some more time learning first and then start answering ;) Although your point of using quotes was good, just say so without code as the above would always result in the value "Array". In a more general sense, it's most likely $Foo has a space in it or a quote or some undesireable character: // good html <input type="text" name="foo" value="a bar"> // bad html (value becomes 'a' not 'a var') <input type="text" name="foo" value=a var> <input type="text" name="foo" value="<?php echo $var ?>"> Regarding other possible goodies in $var such as characters like < or > or " or whatever ... read this faq: http://www.php.net/manual/en/faq.html.php#faq.html.encoding If the error is something else it's because you did not describe the question very well. Knowing the error would be a huge help. Regards, Philip > > ----- Original Message ----- > From: "Todd Barr" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, February 03, 2003 9:59 AM > Subject: [PHP] Html forms > > > I am having difficulty putting results into an form > > Once the query runs, I have this for my output > > print "<Input type=text name=foo value="; > print $Foo; > print ">"; > > This results in an HTML error > > being apache finds an error AFTER the </html> tag > > Any ideas? > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php