Gossamer Forum
Home : General : Perl Programming :

Writing to database on another server

Quote Reply
Writing to database on another server
Searched high and low and couldn't find an answer to this one, so here goes...

I want to be able to have another server append a record to a database on my server. So I've tried this with:

$logfile = "http://www.myserver.net/mydatabases/my.log";

open (LOG, ">>$logfile") or return;
print LOG "$in{'email'}|$in{'name'}|$in{'other stuff'}\n";
close LOG;

With permissions set OK, this doesn't work. Must I do something else to get the file definition to work with an "http" call - in place of the usual path when I do everything on one server?

TIA,

Quote Reply
Re: Writing to database on another server In reply to
I don't think you can do this!

But maybe you could try writing a script that will log in on the other server (with username and password) and will open the file for logging. But do you really need to log on a different server. can't you put you're log file online (but with a password) you you can retrieve and viewyour log-file everywhere in the world.

Quote Reply
Re: Writing to database on another server In reply to
Did you honestly think you could write to files on another server just like that?

Did it not cross your mind that if this could be done then ANYONE could read, write to, delete or steal any private information.


Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: Writing to database on another server In reply to
How about getting the file from the server (using NET:FTP), then editing it (or adding what you want) on your server, and then putting it back onto the other server with Net::FTP??? This is probably how i would do it. Its quite long winded, but really the only way i can think of you being able to do what you want Cool

Hope this helps

Andy

webmaster@ace-installer.com
http://www.ace-installer.com
Quote Reply
Re: Writing to database on another server In reply to
Like youradds suggested...I would transfer the file using NET::FTP. I used to do this on my website. I would have the info stored on my main server and when I updated that info I would transfer it to another server using NET::FTP.

Later,
Paul

http://www.fullmoonshining.com for Pearl Jam Fans