Hi guys, I need to help I am learning to use the function system.
And this code is not working can you tel me why?
#!/usr/bin/php -q <? $host=localhost; $port=129; system(´telnet $host $port´); ?>
Try this:
<? $host=localhost; $port=129; system(´telnet,$host,$port´); ?>
I try it but it really doesn´t works. The output is ¨Bad Interpreter:Access Denied¨
Originally posted by rIkLuNd Try this: <? $host=localhost; $port=129; system(´telnet,$host,$port´); ?> [/B]
Originally posted by rIkLuNd Try this:
[/B]
then I don't know what to do... I'm a newbie...
maybe [man]system()[/man] can help...
You don't want to be running telnet through system() unless you use 'telnet < mysession.txt', because you can no longer write to the process, i.e. to enter a username or password. You would need [man]popen/man if you only need to write to telnet, or [man]proc_open/man if you need to read and write to the subprocess. Be aware that not everything will work in a pipe like this - some programs need a proper console (ssh for example).