<?php$PORT = 25565;
$HOST = "*****"; //the ip of the bukkit server (in this case it's the same machine)
$password = "*********";
//Can't touch this:
$sock = socket_create(AF_INET, SOCK_STREAM, 0) //Creating a TCP socket
or die("error: could not create socket\n");
$succ = socket_connect($sock, $HOST, $PORT) //Connecting to to server using that socket
or die("error: could not connect to host\n");
//Begin custom code here.
socket_write($sock, $command = md5($password)."<Password>", strlen($command) + 1) //Put md5(password) first to let the server accept the next commands.
or die("error: failed to write to socket\n");
socket_write($sock, $command = "/Command/ExecuteConsoleCommand:time day;", strlen($command) + 1) //Writing text/command we want to send to the server
or die("error: failed to write to socket\n");
socket_write($sock, $command = "Time set to day;", strlen($command) + 1)
or die("error: failed to write to socket\n");
?>/PHP]
[COLOR="silver"]- - - Aktualisiert - - -[/COLOR]
Websend geht nicht ich versuch es schon seit fast einem Tag.
Kann mit jmd. helfen ?
Bei mir kommt die Fehler meldung :
Fatal error: Call to undefined function socket_create() in /homepages/25/d404154388/htdocs/wsb6791361401/TimeSet.php on line 7
Mein code:
[PHP]<?php$PORT = 25565;
$HOST = "*****"; //the ip of the bukkit server (in this case it's the same machine)
$password = "*********";
//Can't touch this:
$sock = socket_create(AF_INET, SOCK_STREAM, 0) //Creating a TCP socket
or die("error: could not create socket\n");
$succ = socket_connect($sock, $HOST, $PORT) //Connecting to to server using that socket
or die("error: could not connect to host\n");
//Begin custom code here.
socket_write($sock, $command = md5($password)."<Password>", strlen($command) + 1) //Put md5(password) first to let the server accept the next commands.
or die("error: failed to write to socket\n");
socket_write($sock, $command = "/Command/ExecuteConsoleCommand:time day;", strlen($command) + 1) //Writing text/command we want to send to the server
or die("error: failed to write to socket\n");
socket_write($sock, $command = "Time set to day;", strlen($command) + 1)
or die("error: failed to write to socket\n");
?>/PHP]
[COLOR="silver"]- - - Aktualisiert - - -[/COLOR]
Websend geht nicht ich versuch es schon seit fast einem Tag.
Kann mit jmd. helfen ?
Bei mir kommt die Fehler meldung :
Fatal error: Call to undefined function socket_create() in /homepages/25/d404154388/htdocs/wsb6791361401/TimeSet.php on line 7
Mein code:
[PHP]<?php$PORT = 25565;
$HOST = "*****"; //the ip of the bukkit server (in this case it's the same machine)
$password = "*********";
//Can't touch this:
$sock = socket_create(AF_INET, SOCK_STREAM, 0) //Creating a TCP socket
or die("error: could not create socket\n");
$succ = socket_connect($sock, $HOST, $PORT) //Connecting to to server using that socket
or die("error: could not connect to host\n");
//Begin custom code here.
socket_write($sock, $command = md5($password)."<Password>", strlen($command) + 1) //Put md5(password) first to let the server accept the next commands.
or die("error: failed to write to socket\n");
socket_write($sock, $command = "/Command/ExecuteConsoleCommand:time day;", strlen($command) + 1) //Writing text/command we want to send to the server
or die("error: failed to write to socket\n");
socket_write($sock, $command = "Time set to day;", strlen($command) + 1)
or die("error: failed to write to socket\n");
?>/PHP]