Hi,
> Brian et al ...
>
> sorry ... i shld have mentioned the context ... I m working on .cgi scripts.
>
> Point 1. There is a button "Hit me" in my script say "A.cgi" which
> goes as follows:-
>
> print qq{ <INPUT $style TYPE=BUTTON VALUE="Hit me" > > _javascript_:SetLocation('B.cgi')">}
>
> where SetLocation is something like below:-
> print qq{
> <script language='_javascript_'>
> function SetLocation(url)
> {window.location=url; }
> </script>
> }
>
> Both the button "Hit me" and the function SetLocation are in A.cgi
>
> Point 2.
> When the button "Hit me" is clicked in "A.cgi", I wanted to set a
> perl variable, say,
> $flag = 1 (as a flag indicating that the button "Hit me" was clicked)
>
> Then i wanted to use $flag for further processing ... like run a
> particular query ... in "B.cgi"
>
> THE PROBLEM: How do i set $flag in A.cgi within the _javascript_ function
> SetLocation() ... so that it is accessible in B.cgi??
Easy answer - thats not possible.
> Is this possible in perl?? If not, how should I go about it ...??
> Hope this gives u a clearer picture!
Yes it does.
Just pass the "$flag" as a parameter to B.cgi.
So instead of using
>print qq{ <INPUT $style TYPE=BUTTON VALUE="Hit me" >
write
print qq{ <INPUT $style TYPE=BUTTON VALUE="Hit me" >
and in B.cgi you can use the following code:
require CGI;
my $query = new CGI;
my $flag = ($query->param('button') eq 'hitme');
HTH
Georg Mavridis
Imperia AG
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
