Display of filled form values after filling the form

Discussion in 'PHP' started by Ayuk Roland, Apr 1, 2008.

  1. #1
    I have filled a template form,using PHP I want to write a script that will insert the values of the filled form to the database and also display the same form will the fields filled with the values inserted into the database.I have succeeded in writing a script that insert the values of the filled form into the database and also display the values inserted but not on the form. So I really need your help on how to echo form with the filled values from the database.
    I rely on your support.
     
    Ayuk Roland, Apr 1, 2008 IP
  2. singh.ajit05

    singh.ajit05 Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hey this is very simple

    just use query to fetch value from database............
    then assing a value in any variable like this
    $name=$rs['name'];

    after that just use like :-

    <input name="name" type="text" value="<?php echo $name;?>">


    this will show output........
     
    singh.ajit05, Apr 1, 2008 IP
  3. Ayuk Roland

    Ayuk Roland Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you for that but it is not sufficient.That will show output but not on the form.I want the output to be the form and the filled values.Please I still which to hear from you
     
    Ayuk Roland, Apr 1, 2008 IP
  4. singh.ajit05

    singh.ajit05 Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Please post some form I will reply with a solution...
     
    singh.ajit05, Apr 1, 2008 IP
  5. Ayuk Roland

    Ayuk Roland Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Here is the html template I want that when you click submit it should submit the form and display that same form with if entries filled with values you inputed originally.
    The form has two fields an image field and an ID field



    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <form name="form1" enctype="multipart/form-data" method="post" action="image1.php">
    <table class="table">
    <tr>
    <td align="right" valign="bottom">Photo:</td>
    <td colspan="3"><input name="PHOTO" type="file" id="PHOTO"><input name="info" type="text">
    <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>height="105"></strong></font></td>
    <td colspan="4" id="inf_photo"> </td>
    </tr>
    </table><input type="submit" name="Submit" id="Submit" value="Save">
    </form>
    </body>
    </html>
     
    Ayuk Roland, Apr 1, 2008 IP