Re: install /setup script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well, you can just put up a regular form, something to the effect of

<form action="create_db.php" method="post">
Hostname <input type="text" name="Hostname">
User Name<input type="text" name="username">
Password <input type="text" name="password">
...
...
...
etc.
</form
and when you submit that form, those variables will be accessible under the $_POST array


such as

$hostName = $_POST['Hostname'];
$userName=$_POST['username'];
etc.

NOTE that doing it this way presents several security issues
1) You should add some checking before connecting to the MySQL database; a user can specify "mysql" as the database and you'd have your tables installed in the mysql database(which is used by mysql for its privilege/user tables and such... I normally make it a practice to NOT mess it with the mysql tables). (e.g. If you plan to drop the database and repopulate it, then specifying "mysql" for database would destroy MySQL's core tables)
2) If you are not familar with the $_POST array, it is the data that you specified between the <form> and </form tag. Just like how there is a <form method="POST"> and <form method="GET">, there is a $_GET array. But many people frown if you have a form that asks for username and password and you submit that via GET(as the values you specified would be appended at the end of the URL).



HTH
-Minuk
----- Original Message ----- From: "bigmark" <neretlis@xxxxxxxxxxxxxx>
To: <php-general@xxxxxxxxxxxxx>
Sent: Monday, October 11, 2004 12:14 AM
Subject: install /setup script



Thanks for the help with the createdb and tables form, now can anyone help
with changing the config.php
(ie: host,user,password) via a form also-- so that it doesnt have to be done
manually within the config script.


Basically i want an install/setup page with all the form elements--

Hostname-
username-
Password-
Choose database name-

Then it installs the database and tables then redirects to the main site
page and the config.php is already configured for them


BigMark

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux