Ask a Question related to PERL Miscellaneous, Design and Development.
-
\Dandy\ Randy #1
Passing data to perl script from Web page
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:
[url]http://www.mysite.com/cgi-bin/remove.pl?user=theemail@address.com[/url]
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 Guest
-
Passing values from web page to php script
Hi Everyone, First excuse my language and the way I explain things. I try to be clear enough. I do have a simple system that processes... -
Passing parameters to a Perl Script from Command Line (Linux)
Hi, I'm fairly new to both programming in shell script (linux) and in programming in perl. I need to pass a parameter to the perl script from... -
passing data from one page to another
I have a .aspx page (we'll call it Form1) with a datagrid on it. The datagrid is populated from a dataset that I manually entered data into (the... -
Passing value from one script on one page to another script on another page.
Hi All, I have what is an easy question for you all, but I have not idea (this is in vbscript). I have this script below that works great. It... -
Passing large ammount of data to php script
Ok, I know you can pass data in the querystring (getURL('http://localhost/output.php?text=hello');), but as far as I can remember there is a limit... -
Purl Gurl #2
Re: Passing data to perl script from Web page
Randy wrote:
(snipped)
> 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:
> [url]http://www.mysite.com/cgi-bin/remove.pl?user=theemail@address.com[/url]
You have included an environment query string.
Why not use it? Dump your "user=" as this only
adds unwarranted complexity.
Purl Gurl
--
#!perl
$ENV{'QUERY_STRING'} = 'sissified_geek@purlgurl.net';
while (<DATA>)
{
if ($_ eq "$ENV{'QUERY_STRING'}\n")
{ next; }
else
{ push (@Array, $_); }
}
print @Array;
print "Location: http://www.purlgurl.net\n\n";
__DATA__
[email]purlgurl@purlgurl.net[/email]
[email]godzilla@purlgurl.net[/email]
[email]sissified_geek@purlgurl.net[/email]
[email]callgirl@purlgurl.net[/email]
PRINTED RESULTS:
________________
[email]purlgurl@purlgurl.net[/email]
[email]godzilla@purlgurl.net[/email]
[email]callgirl@purlgurl.net[/email]
Location: [url]http://www.purlgurl.net[/url]
Purl Gurl Guest



Reply With Quote

