hi
i got allways the same warning on my php page:
Warning: Missing argument 2 for server_online(), called in C:\xampp\htdocs\index.php on line 137 and defined in C:\xampp\htdocs\minecraftserver.inc.php on line 3
Warning: fsockopen(): unable to connect to 25565:0 (Failed to parse address "25565") in C:\xampp\htdocs\minecraft_server.inc.php on line 4
this is my minecraftserver.inc.php:
[syntax=php]<?php
function server_online($server, $port){
fsockopen($server, $port, $errno, $errstr);
return ($errno === 0);
}
?>[/syntax]
heres my index.php:
[syntax=php]<?php
var_dump(server_online($servers[0][1]));
?>
[/syntax]
and my init.inc.php:
[syntax=php]
<?php
$servers = array(
array('server.no-ip.org', '25565'),
);
$path = dirname(__FILE__);
include("{$path}\minecraftserver.inc.php");
?>[/syntax]
can you halp me pls?
thank you,
Sl
Warning: Missing argument 2 for server_online()
-
- Posts: 205
- Joined: Mon Jul 09, 2012 11:13 pm
Re: Warning: Missing argument 2 for server_online()
The error message says it all. You are defining the function here:
[syntax=php]<?php
function server_online($server, $port){
fsockopen($server, $port, $errno, $errstr);
return ($errno === 0);
}
?>[/syntax]
Note that you have two arguments when defining it. $server, and $port. Now, when you are using it here:
[syntax=php]<?php
var_dump(server_online($servers[0][1]));
?>
[/syntax]
Note that you are only using one argument. Also note that you aren't defining $servers, $errno, or $errstr anywhere visible.
[syntax=php]<?php
function server_online($server, $port){
fsockopen($server, $port, $errno, $errstr);
return ($errno === 0);
}
?>[/syntax]
Note that you have two arguments when defining it. $server, and $port. Now, when you are using it here:
[syntax=php]<?php
var_dump(server_online($servers[0][1]));
?>
[/syntax]
Note that you are only using one argument. Also note that you aren't defining $servers, $errno, or $errstr anywhere visible.
<?php while(!$succeed = try()); ?>
Re: Warning: Missing argument 2 for server_online()
ExtremeGaming wrote:The error message says it all. You are defining the function here:
[syntax=php]<?php
function server_online($server, $port){
fsockopen($server, $port, $errno, $errstr);
return ($errno === 0);
}
?>[/syntax]
Note that you have two arguments when defining it. $server, and $port. Now, when you are using it here:
[syntax=php]<?php
var_dump(server_online($servers[0][1]));
?>
[/syntax]
Note that you are only using one argument. Also note that you aren't defining $servers, $errno, or $errstr anywhere visible.
thx for your fast answer!
and thx for your help
so it works now...
~this post can be closed~
Re: Warning: Missing argument 2 for server_online()
Threads don't necessarily need to be closed when the question is answered.