PDA

View Full Version : Quick help? :)



Fehm
04-05-2009, 11:16 AM
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! :)

Excellent2
04-05-2009, 11:48 AM
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.

Joshh
04-05-2009, 01:44 PM
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.

<?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">');

}

}

?>

Fehm
04-05-2009, 03:19 PM
Thanks for you rhelp! :)

Want to hide these adverts? Register an account for free!