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

Hi all..I couldnt find any information on this and any help would be greatly appreciated..

I have a script where I get users email addresses which they submit via a form and they get stored in a text file. What I would like to do is add a tick box for a promotional company i.e. CyberCash and if they tick that they get added to that, instead of storing the email on my server I would like to send the info directly to that site or whoever so the user ticked when they signed up..

I have no idea how to do this, any help would be hugely appreciated.

Many Thanks

John

Replies are listed 'Best First'.
(ar0n) Re: Sending Data
by ar0n (Priest) on Mar 17, 2001 at 19:21 UTC
    You might want to take a look at LWP::UserAgent (available at CPAN) and HTTP::Request, which has the ability to mimic an ordinary webbrowser.

    You'd have to find out which variables the form on their (CyberCash's) site uses (like name, email address, country, etc). With that information you could construct a request that passes your information on to them.

    [ar0n]

Re: Sending Data
by orbital (Scribe) on Mar 17, 2001 at 22:14 UTC
    • First off I want to make you aware of something that could possibly be abused in your logic.
      • I would like to send the info directly to that site or whoever so the user ticked when they signed up

      This sets your form up for possible abuse. Say I didn't like my coworker and I filed out the form a bunch of times with his address and checked the box. Next thing he knows he is getting spammed from everywhere. You should make sure that you have a database to compare with so the user doesn't get submitted multiple times. Or better yet, send a comfirmation email to the email address submitted and have the owner of the email address just reply, if they truely want the promotional emails

    • You also need to make sure that there is a very easy way for the users to be able to remove their name off the list.
    In addition to the LWP and HTTP modules I could easily see doing some of this work with Net::Mail.

    Please remember that no one likes spam!