Re: Passing user data between scripts



game4itguy@xxxxxxxxx wrote:
Hi,

I'm positive this is very basic stuff, but I can't seem to find the
information I need, so if anyone could help I'd appreciate it. This is
what I'm trying to do as clearly as I can describe it...

1. I want a user to input data using the GET method.
2. I want 1.pl to display that data on a webpage.
3. I want a link at the bottom of 1.pl to 2.pl.
4. When the user clicks on the 2.pl link, I want 2.pl to display
exactly the same data as 1.pl.

This probably sounds pretty pointless, but I just want to have an
understanding of how it's done so I can use the concept in later
scripts.

I don't actually have a script written yet, but if one's required to
elicit a response, it would look something like the following off the
top of my head...

#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use strict;
use warnings;
my @userinfo = split(/&/, $ENV{'QUERY_STRING'});

You should almost certainly use CGI. Even more especially so as you are
already using CGI::Carp!

my $data1 = $userinfo[0];
my $data2 = $userinfo[1];
print "Content-type: text/plain", "\n\n";
print "Welcome. $data1, $data2.<p>";
print q{<a href="2.pl">Click here for 2.pl</a>};

Using CGI's functions, something like this (untested):

print q{<a href="2.pl?} . query_string() . q{">Click here for 2.pl</a>};

Althrough I rarely do this. If I want two different scripts to receive
pretty much the same data, I'd usually combine them into one script which
just took another paramter telling it whether you wanted mode1 behavior or
mode2 behavior.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.



Relevant Pages

  • Re: Dynamic form generation
    ... updated structure to replace the table's structure file. ... simple import/export without having to modify any scripts at all. ... whatever database you're using as a backend), display forms, and process ...
    (comp.lang.php)
  • Re: random image display
    ... As per the script for random images in a slide show, ... I would suggest that you use a javascript slideshow and ... scripts here: http://www.dynamicdrive.com/dynamicindex14/index.html ... go to my current gallery and randomly display images? ...
    (microsoft.public.publisher.webdesign)
  • Re: Change Display Names in Exch 03 to Last,First
    ... What type of scripts were you using? ... CSVDE cannot modify information. ... >> I don't see how it should be any different with Exchange 2003. ... >> the Display name will change how the GAL is displayed. ...
    (microsoft.public.exchange.setup)
  • Re: Change Display Names in Exch 03 to Last,First
    ... What type of scripts were you using? ... CSVDE cannot modify information. ... >> I don't see how it should be any different with Exchange 2003. ... >> the Display name will change how the GAL is displayed. ...
    (microsoft.public.exchange.admin)
  • Re: Change Display Names in Exch 03 to Last,First
    ... What type of scripts were you using? ... CSVDE cannot modify information. ... >> I don't see how it should be any different with Exchange 2003. ... >> the Display name will change how the GAL is displayed. ...
    (microsoft.public.exchange.misc)