Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>VIP Item add!</title>
  4. </head>
  5. <body>
  6. Item ID-je:<br>
  7. <input type="text" name="item" />
  8. <br />Cimzett (Karakter):<br>
  9. <input type="text" name="cimzett" /><br />
  10. <input type="submit" value="K&uuml;ld&eacute;s" name="Submit">
  11. </body>
  12. </html>
  13.  
  14.  
  15.  
  16. <?php
  17.  
  18. $host = "127.0.0.1";
  19. $port = "3443";
  20. $username = "user";
  21. $password = "pass";
  22.  
  23. $subject = "VIP Item";
  24. $text = "Tessek, itt a kert itemed! :)";
  25. $itemid = $_POST['item'];
  26. $itemcount = "1";
  27. $recipient = $_POST['cimzett'];
  28.  
  29.  
  30.   if (isset($port) and
  31.       ($socket=socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) and
  32.       (socket_connect($socket, $host, $port)))
  33.     {
  34.       $text="Connection successful on IP $host, port $port";
  35.       socket_write($socket, "USER ".$username."\n");
  36.       sleep(1);
  37.       socket_write($socket, "PASS ".$password."\n");
  38.       sleep(1);
  39.       socket_write($socket, "send items $recipient \"$subject\" \"$text\" ".$itemid."[:".$itemcount."]\n");
  40.       sleep(3);
  41.       socket_close($socket);
  42.     }
  43.   else
  44.     { $text="Unable to connect<pre>".socket_strerror(socket_last_error())."</pre>"; }
  45.    
  46.   echo "<html><head></head><body>".
  47.        $text.
  48.        "</body></html>";
  49.        
  50.        //send items #playername "#subject" "#text" itemid1[:count1] itemid2[:count2] ... itemidN[:countN]
  51.        //send items Davidoff "Test" "Test" 29434[:10]
  52.  
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement