[ back to toc ]

How to Pull Variables Created by CGI Script to HTML Page???

Date: 2002/05/20 10:12

I have a CGI-Based script that generates variables used throughout the

I'm trying to figure out how to pass those variables to an HTML page. A
portion of the script is as follows:


require "$lib/config.pl";
# Pull in required libraries
require "$lib/dbmember.pl";
require "$lib/dbcompany.pl";
require "$lib/ez_html.pl";
require "$lib/web_basic.pl";
# Global variables
# Read in form data
# Validate login
%fields = &LoadMember( $in{'login key'} );
%sponsor_fields = &LoadMember( $fields{'parent'} );

foreach $traffic_prog (keys %def_tkey)
unless $sponsor_fields{$traffic_prog};

This code is from a CGI script that launches an HTML page. My goal is to
use the $sponsor_fields{$traffic_prog} variable in the called HTML page as


How can I do this?

Thanks for the help.


p.s. The script is a modified version of the "LifeStyleNetworker Special
Edition" and my site is on ThirdSphereHosting.
It is a bit hard to answer, because I do not really understand what you
intend to do. A CGI script can not launch an HTML page. What is more: an
HTML page can not be launched. An HTML page is just a bunch of characters
which are not executed unlike a CGI script and thus can not be launched.

A CGI script can print out as a response to the browser an HTML page on
the CGI script standard output. In such a situation the CGI script should
use the Perl variables to print them at appropriate location in the answer
HTML page.

A CGI program can send a redirect response to an URL that may optionally
contain arguments (sloppy called CGI parameters), like '?a=1' In such a
situation the CGI script should include the actual value of the variables
in the URL.


[ back to toc ]