[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-web
Subject:    RE: Sending Variables
From:       Gert Lombard <glombard () everdreamcorp ! com>
Date:       2003-02-20 19:41:07
[Download RAW message or body]

Hi,

The answer to your question is probably not perl-specific, but requires an
understanding of HTML and CGI.
The answer also depends on what you mean with "send a variable to another
page".  
(a) It could mean that you simply want to retrieve the query-string
parameters from index.cgi,
(b) or it could mean you want to pass the same parameters to another page
you link to from index.cgi,
(c) or it could mean you want to redirect to another page and pass the same
parameters,
(d) or maybe something else :-)

(You also don't say how you tried to "receive" the variables in index.cgi.)

For (a), you simply retrieve the query string parameters using param or
url_param:

my $q = new CGI;
my $id = $q->url_param('id');
my $name = $q->url_param('name'); # assuming parameters are properly
URL-encoded

If your question is (b), it's a bit like:

print qq{<A href="other.cgi?id=$id&name=$name">Go to other page</A>};

If your question is (c), it's a bit like:

print $q->redirect("other.cgi?id=$id&name=$name"); 

If your question is (d), sorry! :-)

Good luck!
-Gert

> -----Original Message-----
> From: Rick [mailto:rgkx@yahoo.com]
> Sent: Thursday, February 20, 2003 2:33 AM
> To: perl-win32-web@listserv.ActiveState.com
> Subject: Sending Variables
> 
> 
> Hi , 
> 
>     Maybe this is a stupid question , because I just
> beginning learning 
> Perl ...
> 
> I have for ej : 
> 
> www.mysite.com/index.cgi?id=$var&name=$var2 
> 
> But How can I send a varibles to another page ? 
> I need to send this Two variables to index.cgi , but
> When I try none 
> of Them seems to be reiceived . 
> 
> Thanks , 
> 
> Rick 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> _______________________________________________
> Perl-Win32-Web mailing list
> Perl-Win32-Web@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
_______________________________________________
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic