Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Backup A Webpage


Is there a way with php to backup/mirror a page? I know that I can use file_get_contents() to get the HTML from the page, however how can I get the images etc to be downloaded and stored on the server?




View Complete Forum Thread with Replies

Related Forum Messages:
How To Move Arrays From Html Webpage To Webpage?
There are a couple techniques to move information from different html
web page to web page.
1. URL;
2. Cookie;
3. Form;
4. Session;

All the examples I found are move distinguished variables from page to
page, such as "?weight=20&name='apple'".


I need users choose from the first web page (the arrays will be
generated), then use it in second and third html web pages. How do I
transfer them (arrays) and which way is the best?

For example, if I have two arrays,

$fruit[] = array("apple", "pear", "orange");
and associative array
$myCats["Me"]="Merry";
$myCats["Pi"]="Pippin";
$myCats["He"]="Hergie";

View Replies !
Php Webpage And Form On Webpage!
recently signed up for a text messageing service that can use php script to send required details to specific mobile numbers, Anyways i recieved this code from the company: Code:

View Replies !
Backup
i want to make backup section of mysql data like export in phpmyadmin. when the user click on the button the file .sql (the backup of database) will be download.

View Replies !
DB Backup
Im trying to backup a database from a php script using the following, it runs ok & creates the file backup.sql but the file is 0 bytes, PHP Code:

system ("mysqldump -uUSERNAME -pPASSWORD DATABASENAME > /home/MYSITE/public_html/backupsql/backup.sql");

View Replies !
Php Backup
I have ftp only access to my hosted site. Is there a php tool for backing up the PHP scripts (something like phpadmin provides mysql access/extraction).

View Replies !
Automatic Backup Of SQL
I'ved maked a bacup sistem that saves a specific databases in a dir/ BACKUP .. on submiting a button from a form.

Now I want to make it automatic ... the specific file when is written saves the date and time is saved . PHP Code:

View Replies !
Backup And Restore
I backed up all of my databases at once into a single file by using the alldatabases argument of mysqldump. Now I don't know how to restore them. Does anybody have an idea?

View Replies !
Backup Of Website
I am seeking after a backup script, to take backup of my webspace on
my server, my server is www.servage.net i need to take backup 2 times
per day. Via cronjob on www.cronjob.de but i have seeking i 2 days
without reslut.

Where can i find some webspace / serverspace backup scripts?

View Replies !
Mysql Backup Via Php?
I am wanting to automatically do dump of a mysql database nightly
using cron and some kind of script that will email the whole db structure to
me (as an attachment or as plain text in my email) - including the data in
the db. So, if the db was ever lost, I could go to my email, find the dump
and copy and paste it into the mysql db again.

Does anyone know how to do this in PHP or of a premade (and free) script out
there, preferably written in PHP?

View Replies !
MySQL Backup
I've got a feeling that I may have asked this before but I can't find the
answer if there was one offered so apologies for that...

I've written a little content management system and I want to give the user
the ability to back up their database. I've looked at the relevant pages in
PHPMyAdmin but I'm not any closer to an answer. I just want something very
simple where they click on a link and it displays a complete dump of the
tables and the inserts for them to copy and paste into a .txt file.

View Replies !
Mysql Backup Help Please
I hope this question isn't too far off topic....I'm almost at my wits
end trying to figure this out.

I have a Mysql database and I wish to automate the backup of the
database because I don't wish to rely on the web host doing so. I am
using the "dbsender.php" script, which is written for this exact
purpose (available at hotscripts.com). If I execute the script via my
browser, the database is emailed to me in a 'gzip' format, which is
perfect.....the script works just great. However, when I set a cron
job to automate this task, I get an empty '.gz' file attached to the
email instead of a ".gz" file containing my database.

Seeing as the scipt works properly when executed via the browser, the
script is fine. The cron job does it's task on time, and the empty .gz
attachment even has the correct name to it so I'm sure the command
path is correct.....but the attached .gz file is empty.

What on earth could be wrong? I have tried other scripts with
exactly the same result.

I'll past the code below in case some kind soul can shed some light on
this frustrating problem.

dbsender.php script below

#!/usr/local/bin/php
<?php
// configure your database variables below:
$dbhost = 'localhost' // Server address of your MySQL Server
$dbuser = 'cookie_neil' // Username to access MySQL database
$dbpass = 'airbourne' // Password to access MySQL database
$dbname = 'cookie_shop' // Database Name

// Optional Options You May Optionally Configure

$use_gzip = "yes"; // Set to No if you don't want the files sent in
..gz format
$remove_sql_file = "yes"; // Set this to yes if you want to remove the
..sql file after gzipping. Yes is recommended.
$remove_gzip_file = "no"; // Set this to yes if you want to delete the
gzip file also. I recommend leaving it to "no"

// Configure the path that this script resides on your server.

$savepath =
"/home/cookie/domains/mydomain.co.nz/public_html/dbsender"; // Full
path to this directory. Do not use trailing slash!

$send_email = "yes"; // Do you want this database backup sent to your
email? Fill out the next 2 lines
$to = "my@email.co.nz"; // Who to send the emails to
$from = "database@mydomain.co.nz"; // Who should the emails be sent
from?

$senddate = date("j F Y");

$subject = "MySQL Database Backup - $senddate"; // Subject in the
email to be sent.
$message = "Your MySQL database has been backed up and is attached to
this email"; // Brief Message.


$use_ftp = "no"; // Do you want this database backup uploaded to an
ftp server? Fill out the next 4 lines
$ftp_server = "localhost"; // FTP hostname
$ftp_user_name = "ftp_username"; // FTP username
$ftp_user_pass = "ftp_password"; // FTP password
$ftp_path = "/"; // This is the path to upload on your ftp server!

// Do not Modify below this line! It will void your warranty!

$date = date("mdy-hia");
$filename = "$savepath/$dbname-$date.sql";
passthru("mysqldump --opt -h$dbhost -u$dbuser -p$dbpass
$dbname >$filename");

if($use_gzip=="yes"){
$zipline = "tar -czf ".$dbname."-".$date."_sql.tar.gz
$dbname-$date.sql";
shell_exec($zipline);
}
if($remove_sql_file=="yes"){
exec("rm -r -f $filename");
}

View Replies !
Auto Backup
how will i take auto backup mysql database table data after 6 hours daily? i know that this is very easy to take backup database table or full database manualy by using mysql dump syntax but i need to take it autometicaly daily after 6 hours.

View Replies !
Doing Database Backup
I have this site where I runs on 2 server. One is for backup purposes and one is the main server. I have a portal running and therefore, there are heaps of changes going on my database. the question now is, how can i ensure that both have the up-to-date data?

if either one does an update, i would like to have both databases being updated as well. never done this before and i don't even have a single clue on how to start.

View Replies !
Backup With Mysqldump
I use Windows XP and Apache.

I am trying to backup a database on my local computer with the
following php code:

$dbname = 'ol'
$dbhost = 'localhost'
$dbuser = 'root'
$dbpass = 'password'
$backupFile = $dbname .'-' .date("Y-m-d-H-i-s") . '.sql'
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname >
$backupFile";
if (!system($command, $retval)){die('Backup failed.);}

It does produce a file like C:Program Filesxampphtdocs
onlinelearningol-2007-06-20-13-31-09.sql, but it is empty.

mysqldump.exe is at C:Program Filesxamppmysqlinmysqldump.exe and
the script is sitting in the folder C:Program Filesxampphtdocs
onlinelearning.

When I put a copy of mysqldump.exe in the folder C:Program Filesxampp
htdocsonlinelearning I get a black sreen saying 'Enter password:'.
When I give the password I get a file like this:

-- MySQL dump 10.10
--
-- Host: localhost Database: ol
-- ------------------------------------------------------
-- Server version5.0.18

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,
FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE,
SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

---



View Replies !
Backup Script
I am atempting to make a very very simple MySql Backup page. I have the following code and the backup.sql is blank I have tryed doing the backup in the shell and the mysqldump dosent send anything. where am i going wrong? or is there a script that works that any one has i can use :

<?php

$dbhost = 'localhost';
$dbuser = 'root'; 
$dbpass = '';
$dbname = 'call_log'; 
$filename = "backup.sql";
passthru("mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname > $filename");

?>

View Replies !
BackUp And Email DB Using PHP
I have a DB which needs to be backed up regularly. It is on a shared server.  I need to write a php script that a)backs up the DB and b) kindly emails me the backed up file. I would be happy with a non compressed .sql (text) file.

View Replies !
Backup Database
is there a code that i can export/backup my mysql database from inside a private/admin area of a website? also is there a way to export as say an excell file or sertain sections of a site? i know this can be done inside of phpmyadmin but is there a code to do this from inside an admin section to backup a database/website or download certain section of the website.

View Replies !
Backup Batabase
How do i backup my batabase and script seperatly? any class is available for that?

View Replies !
Backup Mysql
how i can back up mysql database from within a php script? any example, or links.

View Replies !
Backup My Server
I use BQbackup.com to backup my server. I know how to do that. But for some reason I cannot find anywhere on google or message boards on how to do a full server restore from bqbackup.com . I dont even know how to get started. BQBACKUP sucks when it comes to support.

View Replies !
Using PHP To Backup My Site
I'm exploring some of PHP's FTP capabilities, and it struck me that if I could use PHP to make .tar.gz files out of a few select directories, I could make an automatic site backup system that would store backups on another web server. The problem is, I can't find out if PHP will allow you to make a .tar.gz file out of directories. Is this possible, and if so, how is it done?

View Replies !
Taking Backup
Is that possible to take a backup of database in MYSQL by clicking a button we use in a website using PHP.

View Replies !
Restoring A .sql Db Backup
I have a .sql backup of my entire database, and I want to have a php page that will restore that file to a certain database, the query I am using is this:

mysql_select_db("test_forum");

$tableName  = 'test_forum';
$backupFile = 'test_forum.sql';
$query = "LOAD DATA LOCAL INFILE '$backupFile' INTO TABLE $tableName";
$result = mysql_query($query) or die("Failed: ".mysql_error());
I can see the problem in this code too, its right here:

INTO TABLE $tableName

I don't want to restore into a table, I want to restore the entire database.  Is there something I'm missing, or is this not possible?

View Replies !
Backup MySQL DB With PHP
I have been looking for a tutorial for a script to backup my DB but haven't been able to find anything that seems to work. Can someone point me to a good tutorial or give me a simple example.

View Replies !
Daily Backup
In phpMyAdmin there is an export feature. I use this (and save to disk) to perform a backup. Is there a script that anyone knows of that will perform this every 24 hours? I know I can use meta-refresh tags to refresh the page every 24 hours. On the same note, does anyone know a better or another way to perform a backup every 24 hours.

View Replies !
Update From Backup
I have a mySQL .sql file from backup, I now wish to put this on a new server. I have full access to the server (colocated). The file is around 40mb.

View Replies !
Phpmyadmin Backup
I'm using phpmmyadmin. I'm wondering if there is a database backup I should do every night for security. I back-up the database using phpmyadmin.

View Replies !
Backup Of MY ISAM
i am using mysql as backend. my all tables are of MY ISAM type. can i take backup of my tables.+

View Replies !
Database Backup
PHP Code:

$db_connection = mysql_connect("$server","$user","$pass") or die ("No DB Connection");
    $db = mysql_select_db("$db",$db_connection) or die ("Couldn't select DB");

$table1 = datadump ("options");
$table2 = datadump ("tbl_users");

$content = $table1 . $table2;    
    
function datadump ($table) {

    $result .= "# Dump of $table";
    $result .= "# Dump DATE : " . date("d-M-Y") ."";.....

View Replies !
Function For Database Backup
Is there a function that backs up the mysql database you have? Or did the people who wrote phpmyadmin actually write a function for it.

View Replies !
PHP MySQL Website Backup
I've found tantalizing scripts that purport to do exactly what I want (daily DB, weekly website backups) However, through may lack of familiarity with perl and **nix Each one has failed.

Is there a way to use a PHP script to compress the entire website (and the dB on a seperate occasion) into a tar.gz? The zlib functions seem to be for zipping individual files. I can see FTP functions in PHP that should make executing the move. Creating the file seems to be the hard part.

Or is there a way to execute the **nix command line looking stuff from the middle of a PHP script?

Naturally the web-host guys know less than I do about this stuff (comforting). But I can schedule cron jobs and have been successful pointing at a file (which just gives me an error).

View Replies !
Mysqldump Backup/restore
I have been trying to get a backup/restore Script working for some time but have had little luck. Is it possible that i can:

1) Have a script that will backup my database and structure to a file, i.e: backup_current_date_and time.sql

2) Make a PHP script that will let me view all the sql files in a directory on my webserver and restore the one i select?

View Replies !
Automating PHP / MYSQL Backup
I am using php exec to run mysqldump and take a backup of my database, it runs just fine, but someone mentioned that I could get CRON (or something) to automate the running of my backup.php script. My script is called backup.php3 and is located in the ../../web/database directory.

My site is hosted by a ISP, I can run perl, php, mysql, etc but I have absolutely no idea how to set up a CRON script to call a PHP script (I don't know what a cron script is come to that!? All I need is something (simple and easy!) to call and run the backup.php3 script, the php will do the rest!

View Replies !
Backup PostgreSQL With PHP Or Perl
I need to backup a postgres database from a web page so I either have to use PHP or PERL. I'm familiar with backing up and restoring via the shell. Does anyone have an idea on how to do this?

View Replies !
MySQL Database Backup
I'm looking at using PHP and MySQL for a particular website application.
However, I was a bit concerned that if a PHP script went wrong then it would
be possible to accidentally delete or overwrite large chunks of the data in
the database which presumably would then be lost. What is the usual
procedure for these situations?. Is it possible to back up a database
somehow so that data from a previous time can be retrieved?.

View Replies !
Backup MySQL Database
How does one go about using cron jobs to create a MySQL database dump each evening?

I have cPanel with my hosting and when i go to cron jobs i have a 'Command to run:

View Replies !
Mysql Backup Connection In PHP
I notice with PHP if a connection cannot be established to a mysql
server with mysql_connect() PHP will timeout and never try the backup
server. In this example:

$db = mysql_connect('db1.local.net', 'username', 'password');
if (!$db) {
$db = mysql_connect('db2.local.net', 'username', 'password');
}

This works great and connects to the 2nd database if the 1st one
rejects the connection completely; however, if the 1st db is under high
load and doesn't respond for 10+ seconds it never jumps to the 2nd one.
Curious if there's a better way to accomplish this. If the 1st db
doesn't respond in 1 second max I'd like to hop to the 2nd one.

View Replies !
MySQL, Backup A Table In PHP
Assuming the table MYTABLE, i want to run a script to backup the table.
But there does not seem to be a straight forward function in MySQL to
achieve it,

Something like
COPY TABLE MYTABLE, bkpMYTABLE;

What would be the easiest way to do that using php?

I know that i can create a table bkpMYTABLE and INSERT the data from MYTABLE
to bkpMYTABLE but the problem is that i will be using the script to run
updates so i will not always know the structure of the data that the user is
copying, (because the script(s) will be precisely used to update the
structure of the table).

Maybe there is a function to retrieve the current structure and then copy
the data?

Also is there a way of testing if a table exists? and to test if a field
within that table exists?

View Replies !
MYSQL Backup & Restore Using PHP ?
I'm looking for a script that will allow users/admins to have a one
click backup solution for a MYSQL Database..

'BACK DATABASE' button, click and its done...

The a restore option, that shows all current backups, and restores the
selected one with one click...

View Replies !
MySQL Backup W/o Dump?
is there some free script that exports a whole database to a file similar
to mysqldump but without using mysqldump?
It should not be embedded too deeply into an application since I want to
include it into another open-source project without having to disassemble a
major other script such as phpMyAdmin.

View Replies !
E-commerce Cms Backup Solutions
How would i go about scripting in some functionality so as to allow the user of a cms/e-commerce site to backup both the current database structure and data and also the entire contents of the websites root folder, bundle all this into a zip file or other archive for download by the end user. The main purpose of this is to remove the need for me as the developer to do this and to simplify the backup process.

View Replies !
Copy() - Create A Backup
If the script gets $i = 'on' it is supposed to back up the current index into a file called normal.php and then copy hurricane.php into index.php. This should create a backup of the index and then put the hurrican alert in place. Code:

View Replies !
Backup Of Database (Mysql)
i want to take backup of database (Mysql) in php script and then send this on any mail.
Is it possible in PHP?

View Replies !
File Backup Cron Job
I want to make a script that will go through every folder, every file, every image, etc. And put them into a zip file in the same structure. I then want to have it email me the zip file as an attachment. This is completely uncharted territory for me, so i have no ideas. This will be used as a cron job, so it has to do everything itself.

View Replies !
Mysql Backup From Files
The hard drive on our dedicated server has "gone bad" (to use the provider's terminology). Though they were able to get our server up and running to the point where we have ssh & ftp capabilities, they keep saying "bad sectors" are preventing them from bringing the whole thing up. I've been scping files over to a temporary location like a madwoman, but since I can't use mysqldump to backup databases, I need to know if there's another way for me to save our database files?

View Replies !
Backup And Upload To Other Ftp Server
Hi, does anybody know/is able to make a good (free please!) script that does the following:

-Backup the public_html folder
-Backup the SQL database
-Upload it to an ftp server (to another sites ftp)

View Replies !
Backup Restore Web Interface
I will like to thank you first for all your efforts and works in this field. I'm working on a user interface utility who will help the client or customer to restore its own files from our servers database,when he ll need it and for how long he want as long as it's on MySQL server.

View Replies !
Backup Database And Email It To Me
I'm trying to get my db backed up every 24 ours and emailed to me I set it up on a cron job and I get the email but the file is 0 bytes Any ideas? Code:

View Replies !
MySQL Backup Script
I'm looking for a script that I can run periodically (from crontab) that creates a dump from a mysql database, stores it in a folder on the server and maybe sends me a copy via email. I think I would be able to write this myself, but I'm sure there must be some decent ones around. Why reinvent the wheel, right?

View Replies !
Daily Backup Script
you want to automate a daily backup of one of your databases. No problem. Follow these instructions and you can automate a mysql dump with a convenient time stamp. Code:

View Replies !
Email Zip Of Mysql Backup
I have this script which is sending me emails ok, presumably of my db, but Outlook Express is showing me a load of hexadecimal in the email body not a nice attachment - (it does list it in pane view as having an attachment)

here's the script: ...

View Replies !
Script That Generates A DB Backup
I need to make a script that would generate a full MySQL backup, containing all data. I can do the write to file and stuff, all I need is "how do I retrieve all the data in the database?".

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved