Open Smir opened 7 years ago
I will do this string for case:
switch ($_GET['cmd']) {
case "host":
$output = $lg->host($_GET['host']);
break;
case "mtr":
$output = $lg->mtr($_GET['host']);
break;
case "mtr6":
$output = $lg->mtr6($_GET['host']);
break;
case "ping":
$output = $lg->ping($_GET['host']);
break;
case "ping6":
$output = $lg->ping6($_GET['host']);
break;
case "traceroute":
$output = $lg->traceroute($_GET['host']);
break;
case "traceroute6":
$output = $lg->traceroute6($_GET['host']);
break;
}
Whats this for??
Not all people are programmers and sometimes come to the github to find a solution to the problem and nothing more. I wrote a simple solution to this problem.
I have no idea what you posted?
do you mean overwrite line44 with what you posted?
Yes. It is necessary to rewrite this function in line44 to the code that I wrote above.
I just rewrote it to this, PHP 7 likes it now.
$output = $lg->{$_GET['cmd']}$_GET['host']);
$output = $lg->{$_GET['cmd']}($_GET['host']);
There is a missing ( in @Volodya1234 's code
Just installed and can't ping, traceroute or anything to do with that area. `Fatal error: Uncaught Error: Function name must be a string in /ajax.php:44 Stack trace:
0 {main}
thrown in /ajax.php on line 44
Line 44 of ajax.php reads;
$output = $lg->$_GET'cmd';`Regards