Log in

View Full Version : Can't deal with two forms



jangkoo
07-16-2010, 09:47 PM
Hi friends!
I have 1 problem with 2 forms on 1 website.
my site is here
http://leejangkoo.tk/
the problem is that I can't use the form COMMENT,i mean I can't write the comment if I still enable the form chatbox
If i delete the code of chatbox, I can comment and it can display.
So what is the problem and how so solve it.
I have tried many ways in 2 days but it is still like that
the code of 2 forms are
chat box

<?php
echo"<form action='chatbox.php' method='post'>";
if (!isset($_COOKIE["user"])|| $_COOKIE["user"]=="")
{
echo "Your name";
echo "<input type='text' size=20 name='name'>";
}
echo "<textarea cols='22' rows='5' name='message'>Write here</textarea>";
echo "<input style=' background-color:#0F6' name='CHAT' type='submit' value='CHAT' />";
?>
and the comment

<form action="index.php" method="post">
<textarea cols="60" rows="5" name="comment">Write here</textarea>
<br />
<input style=" background-color:#0F6" type="submit" name="COMMENT" value="COMMENT" />
</form>
is this problem with forms or with connecting to database?
the code show chat and comment are

<?php
$sql="select * from chatbox order by chat_id DESC" or die(mysql_error());
$query=mysql_query($sql);

while($row=mysql_fetch_array($query))
{
$i++;
echo "<b style='color:#0C0;font-size:14px'>".$row["username"]."</b> :";
echo "<font size=3>".$row["chat"]."</font>";
echo" <br />";
}
mysql_close();
?>
and
<?php
$result = mysql_query("select * from imgcomment") or
die (mysql_error());
$count=0;
while ($row = mysql_fetch_array($result))
if($count<10)
{
$count++;
echo "<br>\n";
echo "<font color=green size=3px>".$row["username"]."</font>";
echo "<font color=green size=1.5px> said</font>";
echo "<br>\n";
echo "<font color=black size=2px>".$row["comment"]."</font>";
echo "<br>\n";
}
mysql_free_result($result);
?>
Thanks in advance.

jangkoo
07-19-2010, 03:42 PM
zz, none helps? I put each form for 1 name, but no changes :(

jangkoo
07-19-2010, 04:10 PM
oh, I found it. thread solved :D

fastsol1
07-19-2010, 05:53 PM
What was the solution?