/ -> restoretable.php
1 <?php
2
3 // restoretable.php - Restores the table structure from a file created by dumptable.php
4 // restoretable.php - author: Nico Stuurman<nicost@sourceforge.net>
5
6 /***************************************************************************
7 * restores a table from a file created by dumptable *
8 * Takes 'filename' as a get variable *
9 * *
10 * Copyright (c) 2002 by Nico Stuurman *
11 * ------------------------------------------------------------------------ *
12 * This program is free software; you can redistribute it and/or modify it *
13 * under the terms of the GNU General Public License as published by the *
14 * Free Software Foundation; either version 2 of the License, or (at your *
15 * option) any later version. *
16 \**************************************************************************/
17
18 require ("include.php");
19
20 printheader($httptitle,false);
21 navbar ($USER["permissions"]);
22
23 if (!$USER["permissions"] & $SUPER) {
24 echo "<h3 align='center'>Sorry, this page is not for you.</h3>\n";
25 printfooter($db, $USER);
26 }
27
28 $filename=$HTTP_GET_VARS["filename"];
29 if (!$filename) {
30 echo "<h3 align='center'>Usage: restoretable.php?filename=myfilename.</h3>\n";
31 echo "<h3 align='center'>This script restores a table (without content) created by the script dumptable.php.</h3>\n";
32 printfooter ();
33 exit();
34 }
35
36 if (@is_readable($filename)) {
37 include ($filename);
38 echo "<br><h3 align='center'>Created the table: <a href='general.php?tablename=$newtablename'><b>$newtablelabel</b></a></h3>.<br>\n";
39 }
40 else {
41 echo "Could not read the file '$filename'.<br>";
42 }
43
44 printfooter ();
45
46 ?>