Results 1 to 4 of 4

Thread: Quick help? :)

  1. #1
    Join Date
    Apr 2008
    Location
    Derby
    Posts
    4,668
    Tokens
    262

    Latest Awards:

    Default Quick help? :)

    Hey,
    Im making the installer for HabboCMS, as its finally nearing completion!

    And.. i was wondering

    is there anyway that on the click of a submit button, a mysql query is ran and then page is redirected to the next section of the install?

    I want to have the install in steps e.g.: Creaating the Database, Setting up the site name, Admin Account etc...

    If anyone can help i'll be extremely grateful!
    Back for a while

  2. #2
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Obulus View Post
    Hey,
    Im making the installer for HabboCMS, as its finally nearing completion!

    And.. i was wondering

    is there anyway that on the click of a submit button, a mysql query is ran and then page is redirected to the next section of the install?

    I want to have the install in steps e.g.: Creaating the Database, Setting up the site name, Admin Account etc...

    If anyone can help i'll be extremely grateful!
    Use a switch.
    Back for a while.

  3. #3
    Join Date
    Jan 2009
    Posts
    159
    Tokens
    0

    Default

    I'd do something like this, you'd go to install.php?stage=1 and when they submit the form it'd automatically take them to ?stage=2 - obviously where the echos are you add your own code for forms and shizzle, untested but when you test you go to www.yourdomaim.com/install.php?stage=1 the starter page is ?stage=1 erm kk. untested.
    Code:
    <?php
    if ($_GET['stage']) {
        switch ($_GET['stage']) {
    
            case '1':
    
                echo ('
    <h1>Creating Administrator Account</h1>
    <form action="?stage=2" method="post">
    <strong>Admin Username:</strong> <input type="text" value="username" name="username"> <br />
    <strong>Admin Password:</strong> <input type="text" value="password" name="password"> <br />
    <strong>Confirm Password:</strong> <input type="text" value="confirm password" name="confirmpassword"> <br />
    
    <input type="submit" value="Create Account" name="create">');
    
                break;
    
            case '2':
    
                echo ('
    <h1>Creating Administrator Account 2</h1>
    <form action="?stage=3" method="post">
    <strong>Admin Username:</strong> <input type="text" value="username" name="username"> <br />
    <strong>Admin Password:</strong> <input type="text" value="password" name="password"> <br />
    <strong>Confirm Password:</strong> <input type="text" value="confirm password" name="confirmpassword"> <br />
                
    <input type="submit" value="Create Account" name="create">');
    
        }
    
    }
    
    ?>

  4. #4
    Join Date
    Apr 2008
    Location
    Derby
    Posts
    4,668
    Tokens
    262

    Latest Awards:

    Default

    Thanks for you rhelp!
    Back for a while

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •