I think you problem is in your if statement.  See below.

Matthew Schneider
System Admin / Programmer
SKLD Information Services, LLC
303-820-0863

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Avadhani, Subramanya
Sent: Friday, December 03, 2004 4:37 AM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] Search string behaving strangely for null..?

 
Hi guys,
        I am working on a CGI script for Email Management. When I call
one cgi(main) from the other(sub.cgi) (on say form submit). I want to
return to the main.cgi again, and get the value by appending the value
pair to the url. This is working fine, however, everytime I pass a value
to sub.cgi, it gets appended at the URL string. This makes the URL
really long if the user navigated back and forth a lot. To eliminate
this, I have written below code. 

$orig_url = $ENV{'HTTP_REFERER'};
#if ($orig_url = !~/$email_box/) {
if ($orig_url !~ /&email=/) {
$orig_url .= "&email=$emailadd";
} 

To make sure, if there is already no value pair added, then only I add
it. I suppose as the URL initially doesn't contain the string email_box,
it will get the value '', hence the if check is failing always.

Also, can someone suggest a way to trim off the previous value pair for
email_box=$emailadd, and always append only the latest.(I think this is
a better way of doing it)

Appreciate suggestions and help.

-Subbu  

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to