For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > August 2005 > Re: 2 cgi script executions, is it possible?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: 2 cgi script executions, is it possible?
Average_Joe

2005-08-12, 4:00 am

["Followup-To:" header set to comp.lang.perl.misc.]
On 2005-07-12, Douglas McCormick Jr. <sanbitter@gmail.com> wrote:
> Hi there experts,
>
> and also stores the values on my sever space... I can't alter there cgi
> script (because www.cedant.com doesn't want me too)


That could be the real problem, you really should have an ISP that allows
you to change CGI scripts. This is probably going to be a recurring
problem.

> Currently the page I'm writing in all in html, but the tech guy at
> cedant who was practically clueless of what I was asking him, told me I
> could maybe do it through php???


You could probably do the whole thing through PHP, if you wanted to. This
would require re-writing and eliminating the perl CGI script entirely.

> I'm willing to do anything, but I really do want to keep the current
> cgi for the form values--- can I excute more than 1 script with the hit
> of the submit button?


No, and, Yes. :-) (Hope that helps..)

What you can do, is have the CGI script execute another script. This doesn't
work so well with the POST method, but it is possible. You have to set up the
environment (and in the case of POST, stdin) with the form values and then
execute the shell script. If you can't edit the cgi script, then you can't do
it there, have to do that in a way they allow.

Look for the popen type functions in PHP to do this, then, after all the work,
discover the ISP has the popen functions disabled for security reasons..

Personally, I'd recommend finding another ISP. (Kind of a personal rant of
mine, but at the least, an ISP should allow SSH shell access AND CGI access,
this is rare for the commodity <$20.00 hosts.) I have to deal with these type of
hosts quite frequently.

If the CGI script is working and you're happy with it, it would probably be a
heck of a lot easier and quicker to just modify it to suit your needs than it
would be to play gimmicks with multiple scripts.

> I might just have to have use formmail.cgi but
> I'm trying to avoid a second page of submitting (unless I maybe use a
> cookie, right?)


It's hard for me to understand exactly whats going on with the second
script, but I don't think cookies are all that relevant here.

Jamie
--
http://www.geniegate.com Custom web programming
User Management Solutions Perl / PHP / Java / UNIX

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com