Page 1 of 1

error script

Posted: Wed Jul 22, 2009 2:58 pm
by mayanktalwar1988

Code: Select all

<?
$id=$_GET['id'];
<table>
<form action='add_topic.php' method='post'>
<tr><td>Name</td><td>:</td><td><input type='text' id='name' name='name' /></td></tr>
<tr><td>Email</td><td>:</td><td><input type='text' id='mail' name='mail' /></td></tr>
<tr><td>Title</td><td>:</td><td><input type='text' id='title' name='title' /></td></tr>
<tr><td valign='top'>Post</td><td valign='top'>:</td><td><textarea id='post' name='post' rows='7'></textarea></td></tr>
<tr><td> </td><td> </td><td><input type='submit' value='Post Topic' /> <input type='reset' value='Reset Fields' /></td></tr>
<input type='hidden' id='cat_id' name='cat_id' value='".$id."' />
 
</form>
</table>
?>



error
Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\customo\create_topic.php on line 3
where is the prob

and this is the browser adress when this script is called http://localhost/customo/create_topic.php?id=1

Re: error script

Posted: Wed Jul 22, 2009 3:10 pm
by spider.nick
Your error stems from PHP trying to compile your HTML code. If you want to display HTML to the screen, from within PHP, you need to do:

Code: Select all

echo '<table>';
Nick

Re: error script

Posted: Wed Jul 22, 2009 3:18 pm
by mayanktalwar1988
yeah thanks nick now it is working... :D

Re: error script

Posted: Wed Jul 22, 2009 3:22 pm
by mayanktalwar1988
i have one more question ...as you can see from above script it is simple one form....i want to add clickable smileys to be inserted with text..just like phpbb....i am searchin on how to do it..but found nothing ..help