Home  |  Linux  | Mysql  | PHP  | XML
From:Rene Schickbauer Date:Wed Dec  2 00:12:02 2009
Subject:Re: cgi and perl database interaction
Hi!

> Now, the thing is that the PHP scripts also connect to the database and,
> presumably, uphold the connection over the duration of the session so as
> not to disconnect and reconnect continually when the user browses the
> website.
>
> My question is - is it possible to do the same thing with those CGI
> scripts?

CGI scripts are basically scripts executed at the commandline with a few
parameters and environment variables set (each call normally starts a new
instance).

You could look into the various web frameworks if and how they solved the
problem. If you can't install anything on the server besides CGI scripts,
you're probably out of luck, though.

If you CAN install additional software on the server, mod_perl could be the way
to go. Or run your own small perl-based server for those pages on another port,
HTTP::Server::Simple::CGI (or my Maplat-Framework) might fit your profile - you
may even run them as backend only on localhost and use a PHP script as simple
proxy 8-)

It really depends on what you're planing in the long run.

LG
Rene

--
#!/usr/bin/perl #99BoB (C)2004 cavac:prg count drink vessel place act1 act2
@a=@ARGV;$c=$a[0]||99;$b=" ".($a[2]||"bottles")." of ".($a[1]||"beer");$w=" ".
($a[3]||"on the wall").",";do{print"$c$b$w\n$c$b,\n".($a[4]||"take one down").
", ".($a[5]||"pass it around").",\n".--$c."$b$w\n\n";}while($c);print"END!\n";
Navigate in group perl.beginners.cgi at sever nntp.perl.org
Previous Next


Your recent visits
Re: Saving param after new recall of a cgi script
Re: Need help to resove..... ExtUtils-Makemaker comilationS
Re: cgi and perl database interaction
RE: Loading results (via ajax) from a CGI



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants