gevo12321 Posted June 16, 2007 Share Posted June 16, 2007 hi im trying to make a form where it already has default input values and i have this code <?php include 'connect.php'; $query = mysql_query("SELECT button1 FROM layout WHERE page = 'home'") or die(mysql_error()); list($button1) = mysql_fetch_row($query); echo "<form action="test.php" method="post"> Button 1: <input type="text" name="button1" value="$button1"/>"; mysql_close($link) ?> but it gives me Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/content/g/e/v/gevo12321/html/test/form.php on line 5 please help me with this im completely new to php thanks Quote Link to comment https://forums.phpfreaks.com/topic/55844-solved-unexpected-t_string/ Share on other sites More sharing options...
pocobueno1388 Posted June 16, 2007 Share Posted June 16, 2007 First off, you are not escaping your characters. Change this: <?php echo "<form action="test.php" method="post"> Button 1: <input type="text" name="button1" value="$button1"/> "; ?> To: <?php echo "<form action=\"test.php\" method=\"post\"> Button 1: <input type=\"text\" name=\"button1\" value=\"$button1\"/> "; ?> Then you are not ending your statement at the end. Change this: mysql_close($link) To: mysql_close($link); Quote Link to comment https://forums.phpfreaks.com/topic/55844-solved-unexpected-t_string/#findComment-275900 Share on other sites More sharing options...
gevo12321 Posted June 16, 2007 Author Share Posted June 16, 2007 thank you very very very much this is a very fast and helpful forum Quote Link to comment https://forums.phpfreaks.com/topic/55844-solved-unexpected-t_string/#findComment-275901 Share on other sites More sharing options...
pocobueno1388 Posted June 16, 2007 Share Posted June 16, 2007 Yes, this is a great forum for getting and giving help =] Don't forget to press "Topic Solved" in the bottom left corner Quote Link to comment https://forums.phpfreaks.com/topic/55844-solved-unexpected-t_string/#findComment-275903 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.