[ back to toc ]

Transferring data from one cgi script to another

Date: 2002/03/01 10:15

Q:
I have a cgi script, "entry.cgi", which has four "value" fields,
"data_entry{'one'}", "data_entry{'two'}", etc.

How do I transfer these values to another script, "print.cgi"?

Thank you
A:
There are several ways. It all depends on what you want to achieve. You
can send a form as the result of entry.cgi that has action print.cgi and
has all the values in the hidden input fields.

You can send a Location header to redirect to print.cgi and have the
values in the GET parameter following the ? mark.

You can send to the client from entry.cgi in cookies.

You can store the values in a file or a database, and print.cgi can
retrieve it from there.

I advise you that you can tell me the issue that you really want to solve
and I may tell you which is the best suitable solution for the specific
problem.

Regards,
Peter

What I want is for "print.cgi" is to display the same information as
"entry.cgi", but in a different format.

I tried to establish a database, but I don't know if I screwed up the
database, or screwed up "print.cgi's" retreiving the data.

Thanks,
Bill
Q:
A:
>>>
I tried to establish a database, but I don't know if I screwed up the
database, or screwed up "print.cgi's" retreiving the data.
<<<

I do not know either.

Regards,
Peter

Could you explain how to establish a database in one file and access it
from another?

Thank you
Q:
A:
To establish a reliable database in a plain text file is an extremely
complex task that requires several thousand of programmer years.
Fortunately there is no need on your side to do that alone, as other
people have already done it. The result of their programming effort is
MySQL, ProtgreSQL, ORACLE and so on. You can use any of these databases.
You can install and use MySQL free of charge on Linux as well as on
Windows NT thus it is a good choice to learn and experiment.

Regards,
Peter

[ back to toc ]