Jump to content

[SOLVED] How to return values after shell_exec


DMeerholz

Recommended Posts

Hi,

 

I am just getting into PHP so be nice...

 

This is my situation, little bit hard to explain, but I will try.

Making a website that will be connected to my database. (UniVerse... if you heard of it...)

Instead of loggin into the DB each time they have a program that lets you execute a UniVerse program straight from Linux.

Like this...

  /usr/ibm/uv/bin/uvsh "TEST.WEB $PRNO"

TEST.WEB is my program and $PRNO has been submitted from the web.

 

This works fine, I do this

 

$PRNO = $_REQUEST['PRNO'];

$b = <<<EOT

cd /u2/myaccount ; /usr/ibm/uv/bin/uvsh "TEST.WEB $PRNO" 

EOT;

echo shell_exec($b);

?>

 

I can do whatever and send it back to the client no problem,

 

BUT...

 

I want to make it a little more intelligent. And to do this i need to be able to return variables to PHP and then do conditional stuff based on that. I know a subroutine is meant for this, but you cant call a subroutine straight from the command line like that. I guess you need to know a bit about UniVerse to understand completely, but maybe not...

 

Any ideas?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.