How a Perl-CGI script opens a web page and passes values to it? 
Author Message
 How a Perl-CGI script opens a web page and passes values to it?

Im writing a Perl-CGI script that is supposed to read several input
variables from an HTML form. Then, based on the value of one of the
variables decides to open another Perl-CGI web page (out of 4 possible
locations) and passes over the values of those variables to the new
page.

Please help Thanks!



Thu, 12 Sep 2002 03:00:00 GMT  
 How a Perl-CGI script opens a web page and passes values to it?
Im writing a Perl-CGI script that is supposed to read several input
variables from an HTML form. Then, based on the value of one of the
variables decides to open another Perl-CGI web page (out of 4 possible
locations) and passes over the values of those variables to the new
page.

Please help Thanks!



Thu, 12 Sep 2002 03:00:00 GMT  
 How a Perl-CGI script opens a web page and passes values to it?

Quote:

> Im writing a Perl-CGI script that is supposed to read several input
> variables from an HTML form. Then, based on the value of one of the
> variables decides to open another Perl-CGI web page (out of 4 possible
> locations) and passes over the values of those variables to the new
> page.

> Please help Thanks!

You can print a redirect command to the browser.

print "Location:$url\n\n";

$url must be an absolute pathname, including the http://.

an example:

if($condition1) {
 $url = "http://yoursite.com/1.html";

Quote:
}

elsif($condition2) {
 $url = "http://yoursite.com/2.html";
Quote:
}

elsif($condition3) {
 $url = "http://yoursite.com/3.html";
Quote:
}

else {
 $url = "http://yoursite.com/4.html";

Quote:
}

print "Location:$url\n\n";

Hope this helps.

P.S. There IS a comp.lang.perl newsgroup.  In fact, I read this message
from that newsgroup.

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 17 Sep 2002 03:00:00 GMT  
 How a Perl-CGI script opens a web page and passes values to it?


Quote:
>P.S. There IS a comp.lang.perl newsgroup.  In fact, I read this message
>from that newsgroup.

Then your news admin is not doing his job.  comp.lang.perl is long
dead.

Of course, I suppose that if you *do* have it, it's fairly low
traffic... :-)

dha

--

Don't be afraid, we're only elves.
        - stimps, http://mindlink.net/stimpy/



Tue, 17 Sep 2002 03:00:00 GMT  
 How a Perl-CGI script opens a web page and passes values to it?


<SNIP>

Quote:
> > variables decides to open another Perl-CGI web page (out of 4
possible
> > locations) and passes over the values of those variables to the new
> > page.

> > Please help? Thanks!

> You can print a redirect command to the browser.

> print "Location:$url\n\n";

> $url must be an absolute pathname, including the http://.

> an example:

> if($condition1) {
>  $url = "http://yoursite.com/1.html";
> }
> elsif($condition2) {
>  $url = "http://yoursite.com/2.html";
> }
> elsif($condition3) {
>  $url = "http://yoursite.com/3.html";
> }
> else {
>  $url = "http://yoursite.com/4.html";
> }

> print "Location:$url\n\n";

> Hope this helps.

So, how does this pass the values on to the new page?

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 23 Sep 2002 03:00:00 GMT  
 How a Perl-CGI script opens a web page and passes values to it?
look at the docs for LWP::UserAgent, URI::Escape, and CGI.pm. ive written
a script that does basically that.

the web browser request your script.
use cgi.pm to get values passed to it from the form.
use URI::Escape to encode the values back into httpd syntax.
use Rodney's Test to find out which script to call.
pass the encoded data to an LWP::UserAgent with the proper location.

just figure out if you want to use get (passes data encoded at the end of
the url)  or post (passes encoded data in the body of the message). i used
get in my script cause i was only passing a little data, but if you pass a
lot of data to your 2nd script you will probably need to use post.

Quote:





> <SNIP>

> > > variables decides to open another Perl-CGI web page (out of 4
> possible
> > > locations) and passes over the values of those variables to the new
> > > page.

> > > Please help? Thanks!

> > You can print a redirect command to the browser.

> > print "Location:$url\n\n";

> > $url must be an absolute pathname, including the http://.

> > an example:

> > if($condition1) {
> >  $url = "http://yoursite.com/1.html";
> > }
> > elsif($condition2) {
> >  $url = "http://yoursite.com/2.html";
> > }
> > elsif($condition3) {
> >  $url = "http://yoursite.com/3.html";
> > }
> > else {
> >  $url = "http://yoursite.com/4.html";
> > }

> > print "Location:$url\n\n";

> > Hope this helps.

> So, how does this pass the values on to the new page?

> Sent via Deja.com http://www.deja.com/
> Before you buy.

--

TR 53C                            Phone: 757-269-7592


Tue, 01 Oct 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How a Perl-CGI script opens a web page and passes values to it?

2. How to open web page from Perl script

3. Opening a web page with perl scripts

4. Problem serving up Perl CGI script as web page

5. Problem serving up Perl CGI script as web page

6. Safely sending data between a multi-web paged perl based CGI Script

7. Safely sending data between a multi-web paged perl based CGI Script

8. passing a querrystring value from one cgi script to another

9. passing values to cgi script in url

10. Including a CGI script in a Web Page

11. please help - cgi database access script / program for web page

12. Perl passing arguements to a Web Page

 

 
Powered by phpBB® Forum Software