Results 1 to 2 of 2

Thread: form submit problem

  1. #1
    Join Date
    Jan 2012
    Posts
    21
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question form submit problem

    well I have this form:
    PHP Code:
    <form name="enter" action="hand.php" method="post" dir="rtl" accept-charset="utf-8">';
                    echo '
    <p align="right" id="lable">request number:</p><br/>
                            <
    span id="request_number"></span><br/>
                            <
    p align="center" id="lable">send to:</p>
                            <
    select id="userone">';
            $data = mysql_query("SELECT `id`,`firstname`,`lastname` FROM `users`");
                    while($row = mysql_fetch_assoc($data)) {
                        echo '
    <option value="'.$row['id'].'">'.$row['firstname'].' '.$row['lastname'].'</option>';}
                    echo '
    </select><br/>
                            <
    p align="center" id="lable"copy to:</p>
                            <
    select id="usermulti" multiple="multiple">';
            $data = mysql_query("SELECT `id`,`firstname`,`lastname` FROM `users`");
                    while($row = mysql_fetch_assoc($data)) {
                    echo '
    <option value="'.$row['id'].'">'.$row['firstname'].' '.$row['lastname'].'</option>';}
                    echo '
    </select><br/><br/>
                        <
    p align="center" id="lable">need: </p>
                        <
    input type="text" class="input" size="100" /><br/><br/>
                        <
    p align="right" id="lable">type:</p>
                        <
    div id="radio">
                        <
    input type="radio" id="radio1" name="send_type1" /><label for="radio1">problem1</label>
                        <
    input type="radio" id="radio2" name="send_type2" /><label for="radio2">problem2</label>
                        <
    input type="radio" id="radio3" name="send_type3" /><label for="radio3">problem3</label>
                        <
    input type="radio" id="radio4" name="send_type4" /><label for="radio4">problem4</label>
                        <
    input type="radio" id="radio5" name="send_type5" /><label for="radio5">problem5</label>
                        <
    input type="radio" id="radio6" name="send_type6" /><label for="radio6">problem6</label>
                        <
    input type="radio" id="radio7" name="others" /><label for="radio7">other:
                        <
    input type="text" name="others"/></label>
                        </
    div><Br/>
                        <
    p align="right" id="lable">explian:</p>
                        <
    textarea id="text" name="content" style="width:75%" class="tinymce"></textarea>
                        <
    br/>
                        <
    div id="radios">
                        <
    input type="radio" id="radio8" name="important" /><label for="radio8">important</label>
                        <
    input type="radio" id="radio9" name="important0" /><label for="radio9">not important</label></div><br/>
                        
                        <
    input class="realupload" name="attachfile" type="file" id="realupload" value="post file" dir="rtl" title="post" />
                        </
    div><br/>
                        <
    input id="submit" name="submit" type="submit" value="send"  />
                        </
    div>
                        
            </
    form
    and I want to use all of these data to post them at my database, what I face is that my database has col called number of request "number" which should take the number from this form exactly at "request_number" but how can I make it generate the number as unique from this part request_number?
    also how to to submit only one radio for name="radio" and name="radios"?
    my database table look like this:
    id ( PRIMARY - AUTO_INCREMENT)
    number (unique)
    creat_date
    read_date
    send_type
    type
    others
    title
    content
    attachment
    user_id_m
    user_id_req
    user_id_ans
    user_id_res
    user_id_dec
    user_id_dr
    read
    closed
    closed_date
    important

    hope to get help with it, cause I have no idea except submit part of form..

  2. #2
    Join Date
    Jan 2012
    Posts
    21
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Wink

    I've solve it sorry, but it was cause radio make array so when I want to use these data I have to get value from array then insert it at database, so I use foreach to get selected elements inside radio and for the check boxes I used implode so everything working now sorry again if I ask for something seems easy but I didn't notice this part.

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
  •