Jump to content

PHP CLI


gally

Recommended Posts

Hi guys,

First of all... HAPPY NEW YEAR TO EVERYONE

 

Well, Ive some scripts which works as they are expected to do when used with the browser.

Now I would like to use them within a terminal (rxvt). I made some modifications and everything is ok but Im acing a "big" problem with the forms.

Dont know how to handle the action tag.

Im sure that the code will explain everything.

 

echo "1 - AA        2 - BB        3 - CC       4 - DD\n\n";
$handle = fopen ("php://stdin","r");
$inp = fgets($handle);
switch ($inp){
case 1: exec('php /foo/foo1/foo2/myfile.php'); break;
.....
default: echo "\033[1;31m \n\n\n\n WRONG INPUT\n\n\n\033[00m"; die();	
}

 

I correctly read the input ($inp) but when its timie to execute the option1 I get the prompt.

 

Any idea?

 

Thank you in advance

 

Link to comment
https://forums.phpfreaks.com/topic/254125-php-cli/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.