What do you mean by cpanelname.... your saying that, if for example, my username was "onelove" and my password was "password" that I have to write "onelove_onelove" for my username and "onelove_password" for my password?
Also I don't want it to send me an email, I wan't to be able to pass the created file to the logged in manager via a URL redirect.. but if no file exists, then this won't work, neither will emailing it.
I just tried it your way and this is what I got:
Warning: filetype() [function.filetype]: Lstat failed for (null) (errno=2 - No such file or directory) in /home/myusername/public_html/test/dbsender.php on line 85
Warning: fopen(/home/myusername/public_html/test/myusername_siteData-103006-0713pm_sql.tar.gz) [function.fopen]: failed to open stream: No such file or directory in /home/myusername/public_html/test/dbsender.php on line 91
Warning: filesize() [function.filesize]: Stat failed for /home/myusername/public_html/test/myusername_siteData-103006-0713pm_sql.tar.gz (errno=2 - No such file or directory) in /home/myusername/public_html/test/dbsender.php on line 92
Warning: fread(): supplied argument is not a valid stream resource in /home/myusername/public_html/test/dbsender.php on line 92
Warning: fclose(): supplied argument is not a valid stream resource in /home/myusername/public_html/test/dbsender.php on line 93
Database backup created and sent! File name /home/myusername/public_html/test/myusername_siteData-103006-0713pm_sql.tar.gz
And then I checked my email and the gz file it references doesn't exist... it's a null string.