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); ?> 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 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 ??? 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:( 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);? 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? 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 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)? 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 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 :-\ 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? 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. 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. 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
Archived
This topic is now archived and is closed to further replies.