Location: PHPKode > projects > FiForms Framework > FiForms/scripts/importdb.php
<?php
/*  This file is part of the FiForms Framework
    Copyright (C) 2003-2008 by Daniel McFeeters,
    Licensed under the GNU GPL. 
    See LICENSE.txt for details. 
*/
  require_once("authenticate.php");
?>
<html>
<head>
<title>Restore/Import Database</title>
</head>
<body>
<form action="importdb_final.php?app=<?php echo urlencode($_GET['app']);?>" method="post" enctype="multipart/form-data">
<fieldset>
Select a database file below to import, or upload one of your own:
<br />
<select name="selection">
<option>***Select a file***</option>
<?php
    $dir = $FIFORMS_CONFIG['APP_BASE'].$FIFORMS_CONFIG['APP_NAME']."/sql/";
    if ($handle = opendir($dir)) {
        while (($file = readdir($handle)) !== false) {
           if($file != "." && $file != "..")
           {
               echo "<option>$file</option>";
           } 
        }
        closedir($handle);
    }
?>
</select> 
<input type="file" name="sql" /><br />
<?php
if(isset($FIFORMS_CONFIG['AVAILABLE_APP_INFO'][$FIFORMS_CONFIG['APP_NAME']]['appdatabase']))
{
?>
<input type="checkbox" name="wipealltables" />
Check here to erase ALL tables in the existing 
<b><?php
    echo $FIFORMS_CONFIG['AVAILABLE_APP_INFO'][$FIFORMS_CONFIG['APP_NAME']]['appdatabase'];
?></b> 
database before attempting execute the uploaded script. 
DO NOT CHECK THIS OPTION UNLESS YOU KNOW WHAT YOU ARE DOING,
AND BE SURE YOU HAVE A BACKUP FIRST AS THIS <i>WILL</i> DESTROY
ALL OF YOUR DATA.
<br />
<?php
}
?>
You must supply the 
FiForms Update / Installation password below:<br />
<input type="password" name="password" /><br />
<input name="import" type="submit" value="Install Database" />
<a href="javascript:history.go(-1);">Cancel</a><br />
<b>WARNING: This will execute the selected SQL script on the database
server. The script might do harmful things to your database
like erasing or overwriting tables. Please be sure you know
what you're doing before you import your database,
and be sure to backup all your applications first.
</b>
</fieldset>
</form>
</body>
</html>
Return current item: FiForms Framework