Results 1 to 4 of 4

Thread: Can't deal with two forms

  1. #1
    Join Date
    Jul 2010
    Location
    NangYang
    Posts
    20
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Can't deal with two forms

    Hi friends!
    I have 1 problem with 2 forms on 1 website.
    my site is here
    HTML Code:
    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 Code:
    <?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
    PHP Code:
    <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 Code:
     <?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 Code:
     <?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.

  2. #2
    Join Date
    Jul 2010
    Location
    NangYang
    Posts
    20
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    zz, none helps? I put each form for 1 name, but no changes

  3. #3
    Join Date
    Jul 2010
    Location
    NangYang
    Posts
    20
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    oh, I found it. thread solved

  4. #4
    Join Date
    Jul 2010
    Location
    Minnesota
    Posts
    256
    Thanks
    1
    Thanked 21 Times in 21 Posts

    Default

    What was the solution?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •