Janusz has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to have a site with form and send a results to few, but the same scripts on different servers. Is it possible? Thanks

Edited 2002-03-24 by Ovid

Replies are listed 'Best First'.
(Ovid) Re: Please help!
by Ovid (Cardinal) on Mar 24, 2002 at 22:48 UTC

    I assume what you are asking is this: "can I have a Web form submit its data to the same script on different servers?"

    While you might be able to pull something off with JavaScript, you couldn't guarantee that all browsers would handle that properly. Just a straight HTML form will only submit its data to the resource listed in the forms action attribute.

    What I would do is submit the form to a server side process that acts as a user agent and resubmits the data to the other servers. See LWP and LWP::UserAgent.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

      If you only need to work with GETable forms, you can forego the LWP suite entirely by dynamically generating frames with appropriately crafted src attributes for each of the target forms.

      The added bonus to going this way is you don't have to worry about authentication or people using your script to DoS others, since the actual GETing is done by the user's browser. :)

          --k.


      I assume what you are asking is this: "can I have a Web form submit its data to the same script on different servers?" Yes, exactly. Thank you for your answer. I have something like "clasifieds.pl" placed at 6 different servers and I like to have admin possibility for adding the same clasified to all of them from one form. I'm afraid, I can run scripts and have some experience but cannot coding, still. I realize I need a script which duplicate data but I cant do it by myself. Sorry for my english. Regards Janusz
Re: Please help!
by grep (Monsignor) on Mar 24, 2002 at 22:54 UTC

    It's difficult to understand your question, but I believe you are asking 'if you can have the same script on different servers send the information to a single data source'.

    Yes you can, the easiest and most productive is to setup a server running a database server like MySQL or PostgreSQL. You can then make as many remote network connections as you want easily with DBI. There are many examples of how to do this in the DBI docs.



    grep
    grep> cd /pub
    grep> more beer
A reply falls below the community's threshold of quality. You may see it by logging in.