Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Other
Author Message
doffer83
Worker
Worker



Joined: Apr 17, 2011
Posts: 117
Location: Amsterdam

PostPosted: Thu Sep 12, 2013 5:43 am Reply with quote

I want share this with you to know your opinion

---------------------------------------------


Quote:
I use MySQL on a regular basis for development, but also use it for production websites as well. Most website hosts provide access to the cron utility for scheduling jobs. I came across a post the other day that showed how to backup MySQL using the ‘mysqldump’ utility and a PHP script. That solution used the Mail PEAR package to e-mail the database backup file to a specified e-mail address. I thought it would be better to store the backup in my Dropbox account instead of using e-mail.
A quick query on Google pointed me to the DropboxUploader utility on Github. I downloaded the utility and with some minor modifications, was able to create the following PHP script that creates a backup SQL file from the specified database, compressed it into a GZipped tarball, and copies it to a specified folder in my Dropbox account.



Code:
/**

 * Quickly and easily backup your MySQL database and have the .tgz copied to
 * your Dropbox account.
 *
 * Copyright (c) 2012 Eric Silva
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * @author Eric Silva [eric@ericsilva.org] [http://ericsilva.org/]
 * @version 1.0.0
 */

require('DropboxUploader.php');

// location of your temp directory
$tmpDir = "/tmp/";
// username for MySQL
$user = "username";
// password for MySQL
$password = "password";
// database name to backup
$dbName = "my_database";
// hostname or IP where database resides
$dbHost = "localhost";
// the zip file emailed to you will have this prefixed
$prefix = "db_";

// username for Dropbox
$dropbox_user = "dropbox_account";
// password for Dropbox
$dropbox_password = "dropbox_password";
// Destination folder in Dropbox (folder will be created if doesn't yet exist)
$dropbox_dest = "db_backups";

// Create the database backup file
$sqlFile = $tmpDir.$prefix.date('Y_m_d').".sql";
$backupFilename = $prefix.date('Y_m_d').".tgz";
$backupFile = $tmpDir.$backupFilename;

$createBackup = "mysqldump -h ".$dbHost." -u ".$user." --password='".$password."' ".$dbName." > ".$sqlFile;
//echo $createBackup;
$createZip = "tar cvzf $backupFile $sqlFile";
//echo $createZip;
exec($createBackup);
exec($createZip);

try {
    // Upload database backup to Dropbox
    $uploader = new DropboxUploader($dropbox_user, $dropbox_password);
    $uploader->upload($backupFile, $dropbox_dest,  $backupFilename);
} catch(Exception $e) {
    die($e->getMessage());
}

// Delete the temporary files
unlink($sqlFile);
unlink($backupFile);



url :
[ Only registered users can see links on this board! Get registered or login! ]

does it help?? usefull I mean ?

I am looking forward for your opinion raven tm thumb up



yes I do like RavensScripts

_________________
We are sorry that Tony Soprano is dead, We wish Assad the Syrian maffia boss had died instead. RIP Tony 
View user's profile Send private message Visit poster's website
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Thu Sep 12, 2013 9:03 pm Reply with quote

I haven't tested this, but it looks interesting. Thanks!

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Fri Sep 13, 2013 2:03 am Reply with quote

Morning to everyone! This is what I did.

Step #1. I create an account at [ Only registered users can see links on this board! Get registered or login! ]

Step #2. I create a file on the root of my server with the name DropboxUploader.php with the script


Code:
<?php

/**
* Dropbox Uploader
*
* Copyright (c) 2009 Jaka Jancar
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author Jaka Jancar [jaka@kubje.org] [http://jaka.kubje.org/]
* @version 1.1.12
*/
class DropboxUploader {
    /**
* Certificate Authority Certificate source types
*/
    const CACERT_SOURCE_SYSTEM = 0;
    const CACERT_SOURCE_FILE = 1;
    const CACERT_SOURCE_DIR = 2;
    /**
* Dropbox configuration
*/
    const DROPBOX_UPLOAD_LIMIT_IN_BYTES = 314572800;
    const HTTPS_DROPBOX_COM_HOME = 'https://www.dropbox.com/home';
    const HTTPS_DROPBOX_COM_LOGIN = 'https://www.dropbox.com/login';
    const HTTPS_DROPBOX_COM_UPLOAD = 'https://dl-web.dropbox.com/upload';
    /**
* DropboxUploader Error Flags and Codes
*/
    const FLAG_DROPBOX_GENERIC = 0x10000000;
    const FLAG_LOCAL_FILE_IO = 0x10010000;
    const CODE_FILE_READ_ERROR = 0x10010101;
    const CODE_TEMP_FILE_CREATE_ERROR = 0x10010102;
    const CODE_TEMP_FILE_WRITE_ERROR = 0x10010103;
    const FLAG_PARAMETER_INVALID = 0x10020000;
    const CODE_PARAMETER_TYPE_ERROR = 0x10020101;
    const CODE_FILESIZE_TOO_LARGE = 0x10020201;
    const FLAG_REMOTE = 0x10040000;
    const CODE_CURL_ERROR = 0x10040101;
    const CODE_LOGIN_ERROR = 0x10040201;
    const CODE_UPLOAD_ERROR = 0x10040401;
    const CODE_SCRAPING_FORM = 0x10040801;
    const CODE_SCRAPING_LOGIN = 0x10040802;
    const CODE_CURL_EXTENSION_MISSING = 0x10080101;
    protected $email;
    protected $password;
    protected $caCertSourceType = self::CACERT_SOURCE_SYSTEM;
    protected $caCertSource;
    protected $loggedIn = FALSE;
    protected $cookies = array();

    /**
* Constructor
*
* @param string $email
* @param string $password
* @throws Exception
*/
    public function __construct($email, $password) {
        // Check requirements
        if (!extension_loaded('curl'))
            throw new Exception('DropboxUploader requires the cURL extension.', self::CODE_CURL_EXTENSION_MISSING);

        if (empty($email) || empty($password)) {
            throw new Exception((empty($email) ? 'Email' : 'Password') . ' must not be empty.', self::CODE_PARAMETER_TYPE_ERROR);
        }

        $this->email = $email;
        $this->password = $password;
    }

    public function setCaCertificateDir($dir) {
        $this->caCertSourceType = self::CACERT_SOURCE_DIR;
        $this->caCertSource = $dir;
    }

    public function setCaCertificateFile($file) {
        $this->caCertSourceType = self::CACERT_SOURCE_FILE;
        $this->caCertSource = $file;
    }

    public function upload($source, $remoteDir = '/', $remoteName = NULL) {
        if (!is_file($source) or !is_readable($source))
            throw new Exception("File '$source' does not exist or is not readable.", self::CODE_FILE_READ_ERROR);

        $filesize = filesize($source);
        if ($filesize < 0 or $filesize > self::DROPBOX_UPLOAD_LIMIT_IN_BYTES) {
            throw new Exception("File '$source' too large ($filesize bytes).", self::CODE_FILESIZE_TOO_LARGE);
        }

        if (!is_string($remoteDir))
            throw new Exception("Remote directory must be a string, is " . gettype($remoteDir) . " instead.", self::CODE_PARAMETER_TYPE_ERROR);

        if (is_null($remoteName)) {
            # intentionally left blank
        } else if (!is_string($remoteName)) {
            throw new Exception("Remote filename must be a string, is " . gettype($remoteDir) . " instead.", self::CODE_PARAMETER_TYPE_ERROR);
        } else {
            $source .= ';filename=' . $remoteName;
        }

        if (!$this->loggedIn)
            $this->login();

        $data = $this->request(self::HTTPS_DROPBOX_COM_HOME);
        $token = $this->extractToken($data, self::HTTPS_DROPBOX_COM_UPLOAD);

        $postData = array(
            'plain' => 'yes',
            'file' => '@' . $source,
            'dest' => $remoteDir,
            't' => $token
        );
        $data = $this->request(self::HTTPS_DROPBOX_COM_UPLOAD, $postData);
        if (strpos($data, 'HTTP/1.1 302 FOUND') === FALSE)
            throw new Exception('Upload failed!', self::CODE_UPLOAD_ERROR);
    }

    public function uploadString($string, $remoteName, $remoteDir = '/') {
        $exception = NULL;

        $file = tempnam(sys_get_temp_dir(), 'DBUploadString');
        if (!is_file($file))
            throw new Exception("Can not create temporary file.", self::CODE_TEMP_FILE_CREATE_ERROR);

        $bytes = file_put_contents($file, $string);
        if ($bytes === FALSE) {
            unlink($file);
            throw new Exception("Can not write to temporary file '$file'.", self::CODE_TEMP_FILE_WRITE_ERROR);
        }

        try {
            $this->upload($file, $remoteDir, $remoteName);
        } catch (Exception $exception) {
            # intentionally left blank
        }

        unlink($file);

        if ($exception)
            throw $exception;
    }

    protected function login() {
        $data = $this->request(self::HTTPS_DROPBOX_COM_LOGIN);
        $token = $this->extractTokenFromLoginForm($data);

        $postData = array(
            'login_email' => (string) $this->email,
            'login_password' => (string) $this->password,
            't' => $token
        );
        $data = $this->request(self::HTTPS_DROPBOX_COM_LOGIN, http_build_query($postData));

        if (stripos($data, 'location: /home') === FALSE)
            throw new Exception('Login unsuccessful.', self::CODE_LOGIN_ERROR);

        $this->loggedIn = TRUE;
    }

    protected function request($url, $postData = NULL) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, (string) $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
        switch ($this->caCertSourceType) {
            case self::CACERT_SOURCE_FILE:
                curl_setopt($ch, CURLOPT_CAINFO, (string) $this->caCertSource);
                break;
            case self::CACERT_SOURCE_DIR:
                curl_setopt($ch, CURLOPT_CAPATH, (string) $this->caCertSource);
                break;
        }
        curl_setopt($ch, CURLOPT_HEADER, TRUE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
        if (NULL !== $postData) {
            curl_setopt($ch, CURLOPT_POST, TRUE);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
        }

        // Send cookies
        $rawCookies = array();
        foreach ($this->cookies as $k => $v)
            $rawCookies[] = "$k=$v";
        $rawCookies = implode(';', $rawCookies);
        curl_setopt($ch, CURLOPT_COOKIE, $rawCookies);

        $data = curl_exec($ch);
        $error = sprintf('Curl error: (#%d) %s', curl_errno($ch), curl_error($ch));
        curl_close($ch);

        if ($data === FALSE) {
            throw new Exception($error, self::CODE_CURL_ERROR);
        }

        // Store received cookies
        preg_match_all('/Set-Cookie: ([^=]+)=(.*?);/i', $data, $matches, PREG_SET_ORDER);
        foreach ($matches as $match)
            $this->cookies[$match[1]] = $match[2];

        return $data;
    }

    protected function extractToken($html, $formAction) {
        $quot = preg_quote($formAction, '/');
        $pattern = '/<form [^>]*' . $quot . '[^>]*>.*?(?:<input [^>]*name="t" [^>]*value="(.*?)"[^>]*>).*?<\/form>/is';
        if (!preg_match($pattern, $html, $matches))
            throw new Exception("Cannot extract token! (form action is '$formAction')", self::CODE_SCRAPING_FORM);
        return $matches[1];
    }

    protected function extractTokenFromLoginForm($html) {
        // <input type="hidden" name="t" value="UJygzfv9DLLCS-is7cLwgG7z" />
        if (!preg_match('#<input type="hidden" name="t" value="([A-Za-z0-9_-]+)" />#', $html, $matches))
            throw new Exception('Cannot extract login CSRF token.', self::CODE_SCRAPING_LOGIN);
        return $matches[1];
    }

}


Step #3. I open folder admin/modules/backup.php and I remove almost everything letting just this part of the script:

Code:
if ( !defined('ADMIN_FILE') )

{
   die ("Access Denied");
}


This is the whole scripts I created on backup.php

Code:
<?php

/**
 * Quickly and easily backup your MySQL database and have the .tgz copied to
 * your Dropbox account.
 *
 * Copyright (c) 2012 Eric Silva
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * @author Eric Silva [eric@ericsilva.org] [http://ericsilva.org/]
 * @version 1.0.0
 */
if ( !defined('ADMIN_FILE') )
{
   die ("Access Denied");
}
require('DropboxUploader.php');

// location of your temp directory
$tmpDir = "/tmp/";
// username for MySQL
$user = "usernamefromyourdatabase";
// password for MySQL
$password = "passwordfromyourdatabase";
// database name to backup
$dbName = "nameofyourphpMyadmindabase";
// hostname or IP where database resides
$dbHost = "localhost or ipfromtheserver";
// the zip file emailed to you will have this prefixed
$prefix = "db_";

// username for Dropbox
$dropbox_user = "emailaddressofyourdropboxaccount";
// password for Dropbox
$dropbox_password = "thepasswordfromyourdropboxaccount";
// Destination folder in Dropbox (folder will be created if doesn't yet exist)
$dropbox_dest = "db_backups";

// Create the database backup file
$sqlFile = $tmpDir.$prefix.date('Y_m_d').".sql";
$backupFilename = $prefix.date('Y_m_d').".tgz";
$backupFile = $tmpDir.$backupFilename;

$createBackup = "mysqldump -h ".$dbHost." -u ".$user." --password='".$password."' ".$dbName." > ".$sqlFile;
//echo $createBackup;
$createZip = "tar cvzf $backupFile $sqlFile";
//echo $createZip;
exec($createBackup);
exec($createZip);

try {
    // Upload database backup to Dropbox
    $uploader = new DropboxUploader($dropbox_user, $dropbox_password);
    $uploader->upload($backupFile, $dropbox_dest,  $backupFilename);
} catch(Exception $e) {
    die($e->getMessage());
}

// Delete the temporary files
unlink($sqlFile);
unlink($backupFile);


Step #4. Fill the info from your phpMyadmin database.

Step #5. Go to your administrator section and click on backup. U will get a blank page because we still need to make a language file. Do not worry. Just Go to [ Only registered users can see links on this board! Get registered or login! ] and click on files. Then you can see the file you backed it up.

NOTE: This is working properly for me. I hope you like my little tutorial. Enjoy.

Very Happy
 
View user's profile Send private message
hicuxunicorniobestbuildpc







PostPosted: Fri Sep 13, 2013 2:23 am Reply with quote

I noticed something in the file I've backed it up

Code:
DROP TABLE IF EXISTS `nuke_bbapprove_posts`;

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `nuke_bbapprove_posts` (
  `approval_id` mediumint(8) unsigned NOT NULL auto_increment,
  `topic_id` mediumint(8) unsigned NOT NULL default '0',
  `post_id` mediumint(8) unsigned NOT NULL default '0',
  `is_topic` tinyint(1) NOT NULL default '0',
  `is_post` tinyint(1) NOT NULL default '0',
  `poster_id` mediumint(8) NOT NULL default '0',
  PRIMARY KEY  (`approval_id`),
  KEY `post_id` (`post_id`),
  KEY `topic_id` (`topic_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `nuke_bbapprove_posts`
--

LOCK TABLES `nuke_bbapprove_posts` WRITE;
/*!40000 ALTER TABLE `nuke_bbapprove_posts` DISABLE KEYS */;
/*!40000 ALTER TABLE `nuke_bbapprove_posts` ENABLE KEYS */;
UNLOCK TABLES;


As you see there is a LOCK TABLES AND UNLOCK TABLES. I wonder how we can handle it when we need to restore database. Any suggestion?

Shocked
 
doffer83







PostPosted: Fri Sep 13, 2013 9:53 am Reply with quote

yes yes.. I am good busy again. I like that Blonde Moment

Embarassed killing me
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sat Sep 14, 2013 9:35 am Reply with quote

Just so you know, we have removed the backup feature already within the next release because all host plans today have this built into their admin panels. The feature creates issues for many with limited hosting plans in terms of either run-times or account sizes.

However, no issue in bringing it back as an add-on as that is the beauty of the platform: so easy to add new modules, whether admin or otherwise. Wink

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
doffer83







PostPosted: Sat Sep 14, 2013 10:41 am Reply with quote

montego, hallo Montego I read site admin I can trust you I think

Tell me please can I use the first methode at post one.. or I can better remain using phpmyadmin

thank you
 
montego







PostPosted: Sat Sep 14, 2013 6:30 pm Reply with quote

doffer83,

I prefer not to have something on my site that can take my entire DB and send it off somewhere else... Laughing However, I cannot see any immediate alarming code in what you have posted. I have modified slightly the code below just to add a little more "protection" - only works on RN 2.50/2.51.

Code:


if ( !defined('ADMIN_FILE') )
{
   die ("Access Denied");
}
require('DropboxUploader.php');

if (is_mod_admin('admin')) {

   // location of your temp directory
   $tmpDir = "/tmp/";
   // username for MySQL
   $user = "usernamefromyourdatabase";
   // password for MySQL
   $password = "passwordfromyourdatabase";
   // database name to backup
   $dbName = "nameofyourphpMyadmindabase";
   // hostname or IP where database resides
   $dbHost = "localhost or ipfromtheserver";
   // the zip file emailed to you will have this prefixed
   $prefix = "db_";

   // username for Dropbox
   $dropbox_user = "emailaddressofyourdropboxaccount";
   // password for Dropbox
   $dropbox_password = "thepasswordfromyourdropboxaccount";
   // Destination folder in Dropbox (folder will be created if doesn't yet exist)
   $dropbox_dest = "db_backups";

   // Create the database backup file
   $sqlFile = $tmpDir.$prefix.date('Y_m_d').".sql";
   $backupFilename = $prefix.date('Y_m_d').".tgz";
   $backupFile = $tmpDir.$backupFilename;

   $createBackup = "mysqldump -h ".$dbHost." -u ".$user." --password='".$password."' ".$dbName." > ".$sqlFile;
   //echo $createBackup;
   $createZip = "tar cvzf $backupFile $sqlFile";
   //echo $createZip;
   exec($createBackup);
   exec($createZip);

   try {
       // Upload database backup to Dropbox
       $uploader = new DropboxUploader($dropbox_user, $dropbox_password);
       $uploader->upload($backupFile, $dropbox_dest,  $backupFilename);
   } catch(Exception $e) {
       die($e->getMessage());
   }

   // Delete the temporary files
   unlink($sqlFile);
   unlink($backupFile);

} else {

   echo 'Access Denied';

}
 
hicuxunicorniobestbuildpc







PostPosted: Sun Sep 15, 2013 3:32 am Reply with quote

thanks Montego for the last piece of codes.
 
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Mon Sep 16, 2013 7:53 am Reply with quote

If you are dealing with backups you also need to deal with the restore process. There is no point having a backup file if you can't restore it. That seems obvious but it's quite common to think you are protected until a crisis happens and you go to restore and you can't.

Google bigdump and go get a copy. Then read through the documentation and install it and test it. It's about the only way you can restore a database on many systems. Otherwise the table sizes are so large that they create resource issues and the restore job bombs.
 
View user's profile Send private message Visit poster's website
kguske







PostPosted: Mon Sep 16, 2013 8:53 am Reply with quote

Thanks for the recommendation on bigdump.
 
doffer83







PostPosted: Tue Sep 17, 2013 6:27 am Reply with quote

Thanks for your answers all of u.. great work
 
hicuxunicorniobestbuildpc







PostPosted: Tue Sep 17, 2013 8:11 am Reply with quote

Bigdump is one of my favorite but in the new version I found out some validation errors.

Search for

Code:
<form method="POST" action="<?php echo ($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">

<input type="hidden" name="MAX_FILE_SIZE" value="$upload_max_filesize">
<p>Dump file: <input type="file" name="dumpfile" accept="*/*" size=60"></p>
<p><input type="submit" name="uploadbutton" value="Upload"></p>
</form>


Replace with

Code:
<form method="post" action="<?php echo ($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">

<input type="hidden" name="MAX_FILE_SIZE" value="$upload_max_filesize" />
<p>Dump file: <input type="file" name="dumpfile" accept="*/*" size="60" /></p>
<p><input type="submit" name="uploadbutton" value="Upload" /></p>
</form>


Last edited by hicuxunicorniobestbuildpc on Tue Sep 17, 2013 3:55 pm; edited 1 time in total 
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Tue Sep 17, 2013 9:47 am Reply with quote

hicuxunicorniobestbuildpc, method="POST" is not xHTML valid! Smile

_________________
Github: RavenNuke 
View user's profile Send private message
fkelly







PostPosted: Tue Sep 17, 2013 12:16 pm Reply with quote

I believe hicux's original correction related to closing / marks in input items. Method type should be lower case too. Regardless, this is a batch program run by an admin on a (hopefully) one-time basis. While there's never an excuse for non-validating code, we need to keep this in perspective. It is not a web page that will be served out to hundreds or thousands of users with a myriad of browser types repeatedly. If you want it corrected it would probably be best to contact the bigdump authors and let them know about it.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Other

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©