Results 1 to 3 of 3

Thread: Installation database form

  1. #1
    Join Date
    Oct 2008
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Installation database form

    in install.php

    how can I make a form for database data.

    I mean instead of I write

    $db_server = "db_server";
    $db_user = "db_user";
    $db_pass = "db_pass";
    $db_name = "dbname";

    I need to fill the data throu the form.

    Plz I need code to understand it

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    PHP Code:
    <?php
    if(isset($_POST['submit']))
    {
        
    $db_server=$_POST['dbserver']; // Database server textbox
        
    $db_user=$_POST['dbuser']; // Database user textbox
        
    $db_pass=$_POST['dbpass']; // Database password textbox
        
    $db_name=$_POST['dbname']; // Database name textbox
        
        /*echo "
        Server: <strong>{$db_server}</strong><br>
        Database User: <strong>{$db_user}</strong><br>
        Database Pass: <strong>{$db_pass}</strong><br>
        Database Name: <strong>{$db_name}</strong><br><br>
        "; // Output the connection*/
    }
    ?>
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    Database Server: <input type="text" name="dbserver"><br>
    Database User: <input type="text" name="dbuser"><br>
    Database Password: <input type="text" name="dbpass"><br>
    Database Name: <input type="text" name="dbname"><br>
    <input type="submit" name="submit" value="Submit">
    </form>
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Oct 2008
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you rangana

    I am so gratful

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
  •