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