PCCS MySQLDatabase Admin Tool version 1.3.4


/incs/ -> upload_function.php

1  <?php
2 
3  // Filename: upload_function.php
4  // Function: functions need for file uploads
5  //
6  // updated 10-07-2000
7  // -- added changelog to this file
8  // .. really hadn't decide how this is going to work
9  // code more than likely will change...
10 
11  function upload_form() {
12   global $PHP_SELF;
13 
14          print "\n<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"" . $PHP_SELF . "?action=upload&task=upload" . "\"METHOD=\"post\">";
15          print "\n<INPUT TYPE=\"hidden\" NAME=\"MAX_FILE_SIZE\" VALUE=\"" . $max_file_size . "\">";
16          print "\n<P>Upload Database Dump File";
17          print "\n<BR><INPUT NAME=\"the_file\" TYPE=\"file\" SIZE=\"35\"><br>";
18          print "\n<BR><INPUT TYPE=\"submit\" VALUE=\"Upload Dump File\">";
19          print "\n</FORM>";
20  }
21 
22  $default_path = "/home/www/htdocs/pccs_mysqladm/dumpfiles";
23  function upload_file($the_file) {
24    global $default_path;
25          if(file_exists($the_file));
26          $this_file_name = date("YmdHms") . "_dumpfile.sql";
27                  if(!copy($the_file,$default_path . "/" . $this_file_name)) {
28                   echo "\n<B>Something happened</B>";
29                  } else {
30                   print "\nUploaded Files:<BR>";
31                          print "mysql -uroot -psimple dbname < $this_file_name";
32                          // exec("/usr/local/bin/mysql -uroot -psimple dbname < $this_file_name";
33                          }
34                  print "<HR>";
35  }
36   
37  ?>


Generated: Sat Jan 27 15:40:36 2001 Generated by PHPXref 0.1.2
PCCS-Linux.COM ::ource Advocate Articles catalogue
2000 2002