chris_2001 Posted October 29, 2007 Share Posted October 29, 2007 Im wondering how to send Ctrl Ctrl G to a program. Ive got an example below how I connect to it to get stats from it. It works fine, just dont know how to send a command to it :/ <?php $host = ****; $port = *****; $gliderpass = ******; echo "<pre>"; $fp = fsockopen($host, $port); if(!$fp) { echo "This bot is not online\r\n"; exit; } fputs($fp, $gliderpass . "\r\n"); echo "Sending status command:\r\n"; fputs($fp, "/status\r\n"); $status = ""; while(1){ $packet = fread($fp, 8192); $status .= $packet; if(substr($packet, -5) == "---\r\n") break; } $status = explode("\r\n", $status); // if you want to remove undesired stuff //$status = array_slice($status, 0, 6); print_r($status); fclose($fp); ?> Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/ Share on other sites More sharing options...
chris_2001 Posted October 29, 2007 Author Share Posted October 29, 2007 Anyone? Its kind of urgent sorry for bump Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380517 Share on other sites More sharing options...
chris_2001 Posted October 29, 2007 Author Share Posted October 29, 2007 ??? Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380570 Share on other sites More sharing options...
chris_2001 Posted October 29, 2007 Author Share Posted October 29, 2007 no one:( Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380612 Share on other sites More sharing options...
effigy Posted October 29, 2007 Share Posted October 29, 2007 echo chr(7);? Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380614 Share on other sites More sharing options...
chris_2001 Posted October 29, 2007 Author Share Posted October 29, 2007 echo chr(7);? hmm? Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380617 Share on other sites More sharing options...
chris_2001 Posted October 29, 2007 Author Share Posted October 29, 2007 Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380669 Share on other sites More sharing options...
effigy Posted October 29, 2007 Share Posted October 29, 2007 What more do you want? Did you send chr(7)? Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380670 Share on other sites More sharing options...
chris_2001 Posted October 29, 2007 Author Share Posted October 29, 2007 I meant what context would i have to send it in :-\ I've never acutally sent a command to a program (havnt been using php for that long) Thx for helping, rly appreciate it Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380690 Share on other sites More sharing options...
chris_2001 Posted October 29, 2007 Author Share Posted October 29, 2007 :-\ Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380761 Share on other sites More sharing options...
dbo Posted October 29, 2007 Share Posted October 29, 2007 Out of context it's hard for us to help you. Can you give us more details? Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380766 Share on other sites More sharing options...
chris_2001 Posted October 29, 2007 Author Share Posted October 29, 2007 I've got a program that you can connect to via fputs() and request its status, and it will send back an array. What i want is to send the keystroke command Ctrl Ctrl G to it, and Im not sure how i would go about doing this. Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380767 Share on other sites More sharing options...
dbo Posted October 30, 2007 Share Posted October 30, 2007 fputs(chr(7)); or something similar is how you would call it i imagine. Quote Link to comment https://forums.phpfreaks.com/topic/75233-sending-command-ctrl-ctrl-g-to-a-program-with-php/#findComment-380785 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.