0

Hi , How can I show CaseID once user has fill up the form .

My database : CaseID , Name , Feedback

The form will require user to enter name and feedback . After submit button is enter , the CaseID should be show to user .

How can I do it ? I am using xampp as database.

3
Contributors
7
Replies
13
Views
3 Years
Discussion Span
Last Post by Muhammad Anas
0

How can I do it ? I am using xampp as database.

@erminasrcutp

How do you want it? PHP or jQuery or javascript?

0

PHP will be given priority

@erminasrcutp

Do you know or familiar with PHP at ?

Edited by LastMitch

0

yes :) well i manage to insert data to database myqsl however i dont manage to show user the caseID which is auto increment

0

yes :) well i manage to insert data to database myqsl however i dont manage to show user the caseID which is auto increment

Post your INSERT query, then we can go from there

Edited by LastMitch

0
<!DOCTYPE>
<html>

<head>
    <title>feedback</title>
  </head>

    <div id="header">  
         <img src='banner.png' align='middle'>
    </div>

    <div id="navigation">            
        <div class="mainMenu">
            <ul><li>
                <a  echo ;   href='main.php' >Main</a>
            </li><li>

                <a  echo class='selected';  href='feedback.php'>
                    New feedback</a>
        </div>
    </div>

    <div id="content"> 

    <form name="borang"  method="post" 
    onsubmit="return checkField()"  enctype="multipart/form-data">

    <table align="center" id="table" >
        <th colspan="2" class="th">feedback form</th>
        <tr>
            <td class="td" colspan="2">
            <br/>
                have to be fill
            <span class="span">*</span> 
            </td>
        </tr>


    <tr>
        <td class="td">
        <br/>
            name
        </td>
        <td>
        <br/> 
        <input type="text" name="name" value="" />
        </td>
    </tr>

    <tr>
        <td class="td">
            feedback 
        </td>
        <td> 
        <input type="text" name="feedback" value="" />
        <span class="span">*</span> 
        </td>
    </tr>


        <tr>
            <td class="td">                   
            </td>
            <td class="td" >
                <br/>
                <button type="submit" value="submit"name="submit"/>
                    check
                </button> 
                <button type="reset" value="reset"/>
                    reset
                </button> 
                <br/>
            </td>
        </tr>
    </table>
    <br><br>

    <?php 
    if (isset($_POST ['submit'])){

    $con = mysql_connect("localhost","root","");
    if (!$con)
    {
        die("Can not connect ".mysql_error());
    }

    mysql_select_db("database",$con);
    $sql = "INSERT INTO aduan(name,feedback)
    VALUES('$_POST[name]','$_POST[feedback]')";
    mysql_query($sql,$con);
    mysql_close($con);
    } 

    ?>

 </form>

  </div>

    <div id="footer">
        Bye bye
    </div>

</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.