Re: [PHP] send group of files at once to website administrator

2003-08-14 Thread Marek Kilimajer
Or you can use a zip class and create an archive. There are at least 2 
free classes that can create zip files.

skate wrote:

Hi,

I have the following code which I use to make regular backups of my
databases. Is there a way to have all backup files sent at once after they
are created, istead of presenting the list of files available for
download?



send an email...

there should be plenty of mime mailers around, just download the code, and
use this as a bolt on to send your email with attachements. it's pretty easy
once you've got the mime part setup and sorted. coding this yourself can be
an arse tho... well, i think so anyway :p




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] send group of files at once to website administrator

2003-08-14 Thread skate

 Hi,

  I have the following code which I use to make regular backups of my
 databases. Is there a way to have all backup files sent at once after they
 are created, istead of presenting the list of files available for
download?



send an email...

there should be plenty of mime mailers around, just download the code, and
use this as a bolt on to send your email with attachements. it's pretty easy
once you've got the mime part setup and sorted. coding this yourself can be
an arse tho... well, i think so anyway :p



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] send group of files at once to website administrator

2003-08-14 Thread anders thoresson
Hi,

I have the following code which I use to make regular backups of my 
databases. Is there a way to have all backup files sent at once after they 
are created, istead of presenting the list of files available for download?

db_connect($dbuser, $dbpassword, $dbdatabase);
	
	// Lock and flush tables before backup
	$query = LOCK TABLES un_article READ, un_article_writer READ;
	$result = mysql_query($query)
		or error(mysql_error());
	$query = FLUSH TABLES;
	$result = mysql_query($query)
		or error(mysql_error());
	
	//	Perform backup	
	$query = BACKUP TABLE un_article, un_article_writer TO 
'c:/web/un/backup';
	$result = mysql_query($query)
		or error(mysql_error());
	
	// Unlock tables
	$query = UNLOCK TABLES;
	$result = mysql_query($query)	
		or error(mysql_error());
	
	// Present all files with link to download
	if ($handle = opendir('/web/un/backup')) 	{
  	echo Files:br\n;
  	 /* This is the correct way to loop over the directory. */
   	while (false !== ($file = readdir($handle))) 		{ 	echo Download $file 
a href='backup/$file'here/abr\n;
   		}
	closedir($handle); 	}	

--
anders thoresson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php