Passing parameters to second script

I have a script that creates a database entry for a new user. After the user has been validated, I create a directory for him or her. So while my first script is meant to create a new user, I have another script which I want to use solely to create the directory.
Here's my question: How do I send these two values, $NEW_USER and $NEW_DIRECTORY_NAME from my first script to my second, and, also, will simply sending these values to the directory-creating script cause the first script to EXIT?
microfleetAsked:
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.

ozoCommented:
The simplest way is probably with <input type="hidden">
0
microfleetAuthor Commented:
I want one script to call another. As far as I know the <input type> is a HTML code. That isnt what I want. After the user has been created, my script should through itself call a second script. It should pass its variables to it. I think by using the REQUIRE statement I can accomplish part of what I want, but there is still a part that I need: I neglected to mention this but the second script needs to be able to read the QUERY_STRING just as if all the form information had been posted to it and not to the first script.
0
ozoCommented:
you can set $ENV{QUERY_STRING} and $ENV{REQUEST_METHOD} before calling the second script.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

microfleetAuthor Commented:
ok, those values are set. How then do I make a direct call to a second script from within my first script?
0
ozoCommented:
If you want the first script to exit when the second script is done, you can exec it,
if you want to return the the first script after the second script is done, you can call it with system,
if the second script is a perl script, you can do it.
0
khacharnCommented:
hi microfleet..
here the answer..i have used this method(it is the only method) for myself..hope it suits you..
i will give you some brief code..
1) Calling program(source.pl)
to execute the target.pl script you will have to write this foll code somewhere in you source.pl script..
****************************************
  start("perl target.pl <parameter>");
****************************************

2) Called program..(target.pl)
In the very beginning of your program you will write this code..  
***************************************
($parameter = $ARGV[0]);
#Now you have the parameter you wanted in your code..
chdir("pathofdirectory");
mkdir("parameter");
**************************************
Hope it helps
Regards
Nitin  
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
microfleetAuthor Commented:
Yes your code does fine; however, I figured out a way to do what I want a few days ago. I forgot I still had this posted. But since you did answer the question, and it was helpful, I'm giving you the points.
Thanks.
0
khacharnCommented:
thanx micro)for the points.
Could you also post how you Did it..for me..
Thanx
Regards
Nitin
0
microfleetAuthor Commented:
khacharn, this is how I POST to a perl script:

'----BEGIN CODE---

Dim Flags As Long, URL as string
Dim TargetFrame As String
Dim PostData() As Byte

URL = "http://www.url.com/cgi-bin/perl.pl"   'You don't need to send a "?"
HEADERS = "Content-Type: application/x-www-form-urlencoded" & vbCrLf

'The ampersands are important!
PostData = "&name=John Doe&email=john@doe.com"

' VB creates a Unicode string by default so you need to
' convert it back to Single byte character set.
PostData = StrConv(PostData, vbFromUnicode)

'send information
WebBrowser.Navigate URL, Flags, TargetFrame, PostData, HEADERS

'---END CODE----
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
Perl

From novice to tech pro — start learning today.