server-php-micro-db-installer-index.php / php
<?php /*------------------------------------------------------------------------------------------ Micro DB Installer �PhpToys 2007 http://www.phptoys.com Released under the terms and conditions of the GNU General Public License (http://gnu.org). USAGE: Just copy the files to your webserver with a valid sql file. You can configure the sql file name by changing the sqlErrorText = ''; sqlStmt = ''; //W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <head> <title>Micro DB Installer</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="main"> <div class="caption">MICRO DB INSTALLER</div> <div id="icon"> </div> <form action="<?php echo _SERVER['PHP_SELF']; ?>" method="post" name="dbdata"> <table width="100%"> <tr><td>Hostname:</td><td><input class="text" name="hostname" type="text" size="20" value="localhost" /></td></tr> <tr><td>Username:</td><td> <input class="text" name="username" type="text" size="20" value="" /></td></tr> <tr><td>Password:</td><td> <input class="text" name="password" type="password" size="20" value="" /></td></tr> <tr><td align="center" colspan="2"><br/><input class="text" type="submit" name="submitBtn" value="Install" /></td></tr> </table> </form> <?php if (isset(host = isset(_POST['hostname'] : ''; _POST['username']) ? pass = isset(_POST['password'] : ''; host,pass); if (f = fopen(sqlFile = fread(sqlFileToExecute)); sqlFile); //Process the sql file by statements foreach (stmt) { if (strlen(result = mysql_query(result){ sqlErrorText = mysql_error(); stmt; break; } } } } ?> <div class="caption">RESULT:</div> <div id="icon2"> </div> <div id="result"> <table width="100%"> <?php if (<tr><td>Installation was finished succesfully!</td></tr>"; } else { echo "<tr><td>An error occured during installation!</td></tr>"; echo "<tr><td>Error code: sqlErrorCode</td></tr>"; echo "<tr><td>Error text: </td></tr>"; echo "<tr><td>Statement:<br/> sqlStmt</td></tr>"; } ?> </table> </div> <?php } ?> <div id="source">Micro DB Installer 1.0</div> </div> </body>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.