JulianD
Well-known member
And where is the file that has the getHtml method?forum/Library/Example/Scripts/serverstatus.php
All is matched.
And where is the file that has the getHtml method?forum/Library/Example/Scripts/serverstatus.php
All is matched.
i just moved it to the same directory, renamed the callback script 'index.php', now i get no error, but i also get no text or anything.And where is the file that has the getHtml method?
Don't use echo. Assign whatever you want to output to the browser to your $output variable.i just moved it to the same directory, renamed the callback script 'index.php', now i get no error, but i also get no text or anything.
<?php
class Example_Scripts_index {
public static function getHtml() {
include '/online.php';
return $output;
}
}
?>
<?php
$output = 'Hello World';
?>
<xen:callback class="Example_Scripts_index" method="getHtml"></xen:callback>
im not using echo.Don't use echo. Assign whatever you want to output to the browser to your $output variable.
that worked.As an example change your index.php to this:
PHP:<?php class Example_Scripts_index { public static function getHtml() { //include '/forum/serverstatus/online.php'; $output = 'Hello World'; return $output; } } ?>
didnt work. i even tried moving the file to the root directory and still not working.I don't think you are including the online.php file correctly. Use a relative or full path. The way you have it right now is assuming you have online.php in the root of your file system.
nope. my path is actually /var/www/vhosts/domain.com/httpdocs/forum/serverstatus/online.php and that doesnt work either.The include should be something like:
PHP:include '/home/path/www/forum/serverstatus/online.php';
Can you repost the content of your online.php file?nope. my path is actually /var/www/vhosts/domain.com/httpdocs/forum/serverstatus/online.php and that doesnt work either.
Can you repost the content of your online.php file?
<?php
$ip = "xxx.xxx.xxx";
$port = "xx";
$online = @fsockopen( $ip, $port, $errno, $errstr, 200);
if($online >= 1) {
echo '<a href="#"><img src="/forum/serveronline.png"></a>';
}
else {
echo '<a href="#"><img src="/forum/serveroffline.png"></a>';
}
?>
PHP:<?php $ip = "xxx.xxx.xxx"; $port = "xx"; $online = @fsockopen( $ip, $port, $errno, $errstr, 200); if($online >= 1) { echo '<a href="#"><img src="/forum/serveronline.png"></a>'; } else { echo '<a href="#"><img src="/forum/serveroffline.png"></a>'; } ?>
nope. tis no working.As a test, change the online.php to this:
PHP:<?php $output = 'Hello World'; ?>
Also make sure index.php returns $output.
no work. this is frustrating me.Don't use echo. Instead, assign that output to $output.
no work. this is frustrating me.
<?php
$ip = "xxx.xxx.xxx";$port = "xx";$online = @fsockopen( $ip, $port, $errno, $errstr, 200);
if($online >= 1) {
echo '<a href="#"><img src="/forum/serveronline.png"></a>';
}
else {
echo '<a href="#"><img src="/forum/serveroffline.png"></a>';
}
exit;
?>
nope. nothing from that file gives an output. im moved it everywhere... nowhere works.Does direct access to that file (with echo's) give output?
nope. tis no working.
We use essential cookies to make this site work, and optional cookies to enhance your experience.