PDA

View Full Version : [PHP] Kick


Magoth78
08-25-2005, 12:53 PM
Hello,

I've coded a simple php kick request by a telnet connection It will send a message to the character who's being kicked, wait for 4 second then kick him.



<?php

$Server = 'your_host.com';
$Port = 9000;
$user = "user\r";
$pass = "pass\r";

$kickedchar = $_POST['kickedchar'];
$message = $_POST['message'];


$fp = fsockopen($Server, $Port);

fputs ($fp, $user);
//echo("Login Accepted\r\n");
usleep(125000);
fputs ($fp, $pass);
usleep(125000);
//echo("Password Accepted\r\n");
fputs($fp, "tell $kickedchar $message\r");
sleep(4);
fclose($fp);

$fp = fsockopen($Server, $Port);
fputs ($fp, $user);
//echo("Login Accepted\r\n");
usleep(125000);
fputs ($fp, $pass);
usleep(125000);
fputs($fp, "kick $kickedchar\r");
echo("$kickedchar has been kicked out!");
fclose($fp);

?>


and the html..

<HTML>
<BODY>
<FORM METHOD="post" ACTION="kick_char.php">
Character Name : <INPUT TYPE="text" SIZE="20" NAME="kickedchar"><BR>
Message to say : <INPUT TYPE="text" SIZE="60" NAME="message"><BR>
<INPUT TYPE="submit" VALUE="Envoyer" NAME="valider">
</FORM>
</BODY>
</HTML>


I'm actually working on a Php-portal with the important GM features to admin the server. I think that could help.

Mag

Belfedia
08-25-2005, 07:48 PM
All is writen could help :)
But i say "big thanks" to your splendid idea :)

Magoth78
08-26-2005, 11:31 AM
It's done. Check the development forum.
----
C'est fait, Belfedia :) enfin ce n'est qu'une premiere version mais ca marche pas mal :P

Mag