Passing data to perl script from Web page

Discussion in 'Perl Misc' started by \Dandy\ Randy, Sep 10, 2003.

  1. Hey peoples, perhaps you could help me with this tricky code I'm hoping to
    build. I have developed a small emailing program for my business. At the
    bottom of the emails that get sent out, there is an option for a recipient
    to remove themselves from my mailing list.

    Here is what I am looking to do. At the bottom of the email, the removal
    link would contain something like this:

    To remove yourself from my mailing list, click here:
    http://www.mysite.com/cgi-bin/remove.pl?user=

    I am looking to have my perl script read the referring link and detect the
    user= tag ... them perform the necessary function to splice that email from
    my database ... Can Perl do this? Below is an example of the theoretical
    code. Note: the second line is not valid perl code obviously, simply my
    goal:

    #!/usr/bin/perl

    $theuser = HTTP{REFFERAL_TAG, 'user'}; #scan the reffering html URL for the
    "user" variable

    open (ADDRESSES, "<data/addressbook.txt") or !die ("Unable to open");
    @recipients=<ADDRESSES>;
    close(ADDRESSES);

    foreach $recipients(@recipients) {
    $count++;
    if ($recipients =~ /$theuser/i) {
    $count--;
    splice(@recipients, $count, 1);
    }

    print "Location: $confpage\n\n"; #redirects to a confirmation page

    Please let me know if this can be done, and/or if it cannot be done and you
    have an alternate idea. Code examples are welcomed. Thanx everyone!

    Randy
     
    \Dandy\ Randy, Sep 10, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,802
  2. Robert Cohen
    Replies:
    3
    Views:
    273
    Andrew Durstewitz
    Jul 15, 2003
  3. vikrant
    Replies:
    4
    Views:
    279
  4. PhEaSaNt PLuCKeR

    perl script to pass data to another perl script?

    PhEaSaNt PLuCKeR, Oct 30, 2005, in forum: Perl Misc
    Replies:
    1
    Views:
    154
  5. doni
    Replies:
    3
    Views:
    147
    Josef Moellers
    Dec 10, 2007
Loading...

Share This Page