DMeerholz Posted June 28, 2007 Share Posted June 28, 2007 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 https://forums.phpfreaks.com/topic/57529-solved-how-to-return-values-after-shell_exec/ Share on other sites More sharing options...
DMeerholz Posted June 28, 2007 Author Share Posted June 28, 2007 Damn that was stupid, instead of echo shell_exec($a); $x = shell_exec($a); and then i just print the stuff in my program. Link to comment https://forums.phpfreaks.com/topic/57529-solved-how-to-return-values-after-shell_exec/#findComment-284700 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.