insert a form through php mysql.

Discussion in 'PHP' started by ranaji, May 3, 2012.

  1. #1
    I don't know how i can do that through php using mysql.
    i studied from http://phproots.com php tutorial.
     
    ranaji, May 3, 2012 IP
  2. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #2
    The easiest way for you to do this IF you have PHP/SQL knowledge is:
    Allow the users to pick which form they need to use from either a drop-down select box or links. When they pick their form, it will send a submission value (example)
    <option value="form_1"> Form for Such and such </option>
    <option value="form_2"> Form for Next such and such </option>

    then submit by standard button form <input type="submit" value="Submit" onclick="this.form.submit">

    have this send it to the same page in the <form name="index.php method="post" action="index.php"> (or whichever page you're using for this function.

    Once it resends the data that page should have php script at the top to catch them
    <?php
    $form_selected = $_POST['form_selector'];

    // this would then allow the value of 1- 100 (as many forms as you have) to grab a form from a folder/file and display it on that page. with a PHP code in the body of your page that is something such as
    <?php
    if($_POST['form_selector']) {
    $form_display = "Forms/form_" . $form_selected . ".php";

    include($form_display);
    }
    ?>

    ..to have the form displayed. Or use AJAX so that as fast as the user clicks the form they need , it appears to the right. This would be the most aesthetic and fastest/smoothest option. IM me for details on that
     
    ezprint2008, May 4, 2012 IP