My guess is that what you mean to do is occasional updates, not on all te time master-slave replication. The environment you're described isn't really set up for replication.
The script you're describing is pretty simple:
Step 1...on your remote server:. exec ("mysqldump -uUsername -pPassword DatabaseName >sqldumpfile.sql")
If you wanted to you could gzip the file on the server, which compresses an average sqldump file by 70%
Step 2. on your local server: download the sqldumpfile.sql. Easiest would be to use: fopen(), fread(), fclose, but you could just create a browser link to the file and let the browser download it for your.
If it it gzipped, use exec to gunzip it.
Step 3: on your local server: exec(mysql -uUsername -pPassword DatabaseName <sqldumpfile.sql) to replace local db records with reccords dumped from remote db.
Step will take the longest depending on your internet connection speed and the size of your db. The other steps will be very fast.