Quick question ;-)

They have: 88 posts

Joined: Mar 1999

Hi all,

Just wanted to ask a couple of basic questions (sorry)

I want to know whether or not you
could use an if statement to call another
cgi script (syntax?) and if so would the variables
passed to the original script be passed on
to the new one?

e.g.

if (param('M_kwikname') eq '1' ) {
call the new cgi script???}

Secondly, is it good practice to flock() a file
when writing to it? Is there any downsides to doing
this?

Many thanks in advance for any help

Regards

Steve

They have: 60 posts

Joined: Aug 2000

use:
@output = `your call`;
or system("command","a1","a2","a3");
or exec("your call");

Hope it helps

They have: 60 posts

Joined: Aug 2000

About flock file, I think it's a should! But I don't know any drawbacks. Preventing other scripts write to the file at the same time (result: a messed-up file!)

http://new.123finder.com/ - Helps you find cool domains for FREE & Registers it for only $14.95/yr
http://www.ad-rotator.com/ - Free ad rotating system for small websites - Stop Ctrl-P/Ctrl-C the ad code!

------
Son

They have: 88 posts

Joined: Mar 1999

Sorry If i'm being a bit dense - bit of a newbie
but I have structured the exec like this but
just get the dreaded internal error.

if (param('M_kwikname') eq '1' )
exec{'/home/branditnow/cgi-bin/authkwik.pl'}

if (param('transStatus') eq 'Y' ) {
&AUTHORISED;}

if (param('transStatus') eq 'C' ) {
&CANCELLED;}

PS I have tried putting the semi-colon in different places
but still nothing??? Any ideas as to where i'm going
wrong would be greatly appreciated!!

Regards

Steve

They have: 60 posts

Joined: Aug 2000

I think the exec will disregards whatever you have after it!
So use other call (I prefer backticks ``)

Hope it helps!

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

your syntzx is wrong. you need ()'s and 'exec' is outside {}

if (param('M_kwikname') eq '1' ) {
exec('/home/branditnow/cgi-bin/authkwik.pl');
}

if (param('transStatus') eq 'Y' ) {
&AUTHORISED;}

if (param('transStatus') eq 'C' ) {
&CANCELLED;}

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.