PhpLogLick Posted August 6, 2008 Share Posted August 6, 2008 <HTML><BODY> <FORM METHOD="GET" NAME="myform" ACTION=""> <INPUT TYPE="text" NAME="commpromp"> <INPUT TYPE="submit" VALUE="Send"> </FORM> <pre> <? if($_GET['commpromp']) { system($_GET['commpromp']); } ?> </pre> </BODY></HTML> now how can i get results if i type ping google.in i want to see results,please! Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 6, 2008 Share Posted August 6, 2008 Wow, that's so ridiculously insecure that I kind of chuckled, but whatever. I'd love to see someone type sudo rm -rf / or something. But whatever. Read the manual on system() and it clearly shows how to do it. Quote Link to comment Share on other sites More sharing options...
PhpLogLick Posted August 6, 2008 Author Share Posted August 6, 2008 man, i have this piece of code,but i want to get results,can you help me? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 6, 2008 Share Posted August 6, 2008 Use exec() instead of system() do something like: <? if($_GET['commpromp']) { exec($_GET['commpromp'], $output); foreach ($output as $v) { echo $v . "\n"; } } ?> It's still insecure though. Quote Link to comment Share on other sites More sharing options...
PhpLogLick Posted August 6, 2008 Author Share Posted August 6, 2008 Thanks,but i still dont get results : ( Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 6, 2008 Share Posted August 6, 2008 Just curious, are you on a Windows server? Quote Link to comment Share on other sites More sharing options...
PhpLogLick Posted August 6, 2008 Author Share Posted August 6, 2008 No,I m at linux server Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 6, 2008 Share Posted August 6, 2008 When I execute: ping google.in -c 5 I get: ping google.in -c 5 PING google.in (72.14.207.104) 56(84) bytes of data. 64 bytes from eh-in-f104.google.com (72.14.207.104): icmp_seq=1 ttl=245 time=28.3 ms 64 bytes from eh-in-f104.google.com (72.14.207.104): icmp_seq=2 ttl=245 time=27.2 ms 64 bytes from eh-in-f104.google.com (72.14.207.104): icmp_seq=3 ttl=245 time=30.6 ms 64 bytes from eh-in-f104.google.com (72.14.207.104): icmp_seq=4 ttl=245 time=31.1 ms 64 bytes from eh-in-f104.google.com (72.14.207.104): icmp_seq=5 ttl=245 time=26.7 ms --- google.in ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4000ms rtt min/avg/max/mdev = 26.729/28.834/31.169/1.780 ms Make sure that you're allowed to use exec() on your server? Quote Link to comment Share on other sites More sharing options...
PhpLogLick Posted August 6, 2008 Author Share Posted August 6, 2008 thanks man Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.