linking two cgi scripts

i have a form on my web page that i use for people to send pages to my alphanumeric pager.  First, they fill out a form and hit a button, and that perl script mails me the content of their page, and then builds another page with another button on it that they have to hit to run another cgi
script on another pc that i don't have access to...

what i'd like to do is combine these steps..is there a way for me to run the first script,and then hand off the processing to the 2nd script on another computer?  or maybe make the first script open up lynx on my account and enter the data on the 2nd site, returning data whether it
worked or not?

you can see what i'm talking about by going to my web page @ http://www.tensionboy.com/contact.html

tonysebionAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

icdCommented:
As far as I can tell, you have two scripts. The first is one you wrote that logs for your purposes who made the 'call' and the second is one provided by (presumably) the pager company.

My first impression was that you should just include the hidden fields on the second page as hidden fields in the first page, but then I realised you were probably doing further logging.

The next option is to use Javascript or a META command so that when your first script is run it does a refresh to automatically run the second script after a short pause.

The best approach however might be to re-write the second script so that it produces no output (unless there is an error detected), it just carries out the logging function. It would then need to request the document produced by the second script using http and output the result to stdout. In that way although both scripts are run, only the output of the second script is shown.

How to do this will vary depending upon the server software. I have a solution if the server is running on Win95 or NT. If it is UNIX then my code would not work but a similar approach could be worked out.
0
icdCommented:
Sorry, that should read 'The best approach might be to re-write the *first* script'
0
tonysebionAuthor Commented:
okey, if you go to the page and follow it, the first form you fill out (and hit send on) runs a little perl thing that mails me the contents of the page, and builds a 2nd web page with the 2nd form on it (hidden fields contain the data for the 2nd cgi script to follow).

what i want is BOTH cgi's to process (the first one, that i can edit - which mails me the contents of the page, and the 2nd one, which i CAN'T - that actually does the page itself)

i'm against using a scripting language solution, as that's not compatable on all browsers or is turned off for security reasons often...i'd like to do it on my end, and i think the best solution would be to start up lynx on my shell acct and process the second script from within the 1st one, and then dealing w/ the data.....


0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

fasterCommented:
If you have enough time, you can modify your 1st script such that it does not generate another html page for the 2nd script, rather, it directly connects to the 2nd host and send it the whole request using socket.  Actaully your script is acting as a browser.

This is not a simple approach of course.  You need to be familiar  with socket and http.
0
tonysebionAuthor Commented:
ummm, exactly, that's just what i said - now does anyone have an example of that :)
0
icdCommented:
The answer I gave first does what you want.

Script 1. (your script) is modified so that it does not output any html itself.

If running on Windows NT (since you did not answer my query about the server) then you use the WinPerl::Internet module to send an http request to the URL of the second script. This will return the second page in a scalar variable which you can then print. I have a simple example of this which works.

If running UNIX then you need to write a socket program to connect to the URL of the second script. A little bit more complicated but the same principle as above.

The net (pun intentional) result is that the user clicks on a button on the first form, your script is run which runs the second script and the result of the second script is output to the user.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
icdCommented:
I have found a script that although it does not do exactly what you want it will show you how to use sockets to retrieve a URL (i.e. run the second script). I will continue to look for other more immediately relevent scripts but you might want to look at.

http://sunhe.jinr.dubna.su/docs/webcopy.html
0
icdCommented:
An even better script to see socket programming in action is at:-

http://www.cfcl.com/tin/P/9606.nph-rover

0
tonysebionAuthor Commented:
that 2nd one looks like just the thing i need...if i need additional help on this, i'll just ask another question....
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.