0

when executing this command in linux wheezy throug SSH, it works fine;

pi@raspberry /usr/bin $ ./send -u 2 -i 0546845 -f

But how can i put this in for example test.php page (from var/www/test.php) so i can run this in a webpage?

Tried several things, but need some help getting into the right direction.

Many thanks.

2 Answers 2

2

Use the system function.

string system ( string $command [, int &$return_var ] )
Sign up to request clarification or add additional context in comments.

1 Comment

Sorry, don't get this. This works fine: <?php echo '<pre>'; // Outputs all the result of shellcommand "ls", and returns // the last output line into $last_line. Stores the return value // of the shell command in $retval. $last_line = system('ls', $retval); // Printing additional info echo ' </pre> <hr />Last line of the output: ' . $last_line . ' <hr />Return value: ' . $retval; ?> How should i enter my code?
0

I don't know how to reply to an "answer".. hehe..

I think you can simply do this:

system('/usr/bin $ ./send -u 2 -i 0546845 -f');

add that to your php script.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.