Jáá 26 Odesláno: 24. Březen, 2013 Share Odesláno: 24. Březen, 2013 HTML <html> <body> <form action="hladaj.php" method="post"> IP: <input type="text" name="ipserver"> PORT: <input type="text" name="portserver"> <input type="submit"> </form> </body> </html> PHP Pôvodne $query = new SampQuery("127.0.0.1", 7777); a kde do toho mám doplnit $_POST["ipserver"]; a $_POST["portserver"]; http://www.w3schools.com/php/php_forms.asp http://forum.sa-mp.com/showthread.php?t=355574 ak to dám tak to tak to hádže error na tento riadok $query = new SampQuery("$_POST["ipserver"];", $_POST["portserver"]); neviem ako to do toho mám doplnit poradte pls Link to comment Share on other sites More sharing options...
0 steel 71 Odesláno: 24. Březen, 2013 Share Odesláno: 24. Březen, 2013 <!DOCTYPE html> <head> </head> <body> <?php if (isset($_REQUEST['ipserver'])) { $ip = $_POST['ipserver']; $port = $_POST['portserver']; $query = '$ip:$port'; if ($query->connect()) { // If a successful connection has been made print_r($query->getInfo()); // Print server info array print_r($query->getBasicPlayers()); // Print basic players array, connection will time out if the player counter is above 100 and will return an empty array if no players are online $query->close(); // Close the connection } else { echo "Server did not respond!"; } } else { echo '<form method="post" action="hladaj.php">'; echo 'IP: <input type="text" name="ipserver">'; echo 'PORT: <input type="text" name="portserver">'; echo '<input type="submit" value="Submit">'; echo '</form>'; } ?> </body> </html> Link to comment Share on other sites More sharing options...
Dotaz
Jáá 26
HTML
<html>
<body>
<form action="hladaj.php" method="post">
IP: <input type="text" name="ipserver">
PORT: <input type="text" name="portserver">
<input type="submit">
</form>
</body>
</html>
PHP
Pôvodne $query = new SampQuery("127.0.0.1", 7777);
a kde do toho mám doplnit $_POST["ipserver"]; a $_POST["portserver"];
http://www.w3schools.com/php/php_forms.asp
http://forum.sa-mp.com/showthread.php?t=355574
ak to dám tak to tak to hádže error na tento riadok
$query = new SampQuery("$_POST["ipserver"];", $_POST["portserver"]);
neviem ako to do toho mám doplnit poradte pls
Link to comment
Share on other sites
1 odpověd na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now