PDA

View Full Version : Dynamic Ajax content loading .php-files



bavarian
04-03-2006, 11:54 AM
I am using the Dynamic Ajax Content script with big pleasure. But trying to adjust it to my needs and trying to provide content from .php-files. On the page for the script it reads "The "Forum Archives" link illustrates how you're not limited to just loading html pages, but also dynamically generated pages (ie: php)." Unfortunately the links there make me end up at an error page of "Dynamic Drive site error" otherwise I would have tried to read there ....

Been playing around with a .php-file, where i wanted to load the text from given by ECHO "texttexttext" command from within the php-file. that works.

now the problem: i am using the Dyn. Ajax Content script within a CMS (phpnuke), more specifically from within a module of phpnuke. phpnuke offers a multilanguage feature that i want to make use of in this php-file, that the Ajax script is supposed to load. not an expert in php-programming i used this code


require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

to include a file that would activate the multilanguage featue (at least i think it should). it calles a funktion in the mainfile.php executing this code


function get_lang($module) {
global $currentlang, $language;
if (file_exists("modules/$module/language/lang-".$currentlang.".php")) {
if ($module == "admin") {
include_once("admin/language/lang-".$currentlang.".php");
} else {
include_once("modules/$module/language/lang-".$currentlang.".php");
}
} else {
if ($module != "Forums") {
if ($module == "admin") {
include_once("admin/language/lang-".$currentlang.".php");
} else {
include_once("modules/$module/language/lang-".$language.".php");
}
}
}
}

but from here on the echo command in the php-file does not bring up any text any longer ... no error message or any garbled text, nothing .... seems to me as if the code is executed somehow problemfree, but some problem must be somewhere in there.

how to resolve this? i know my question might cover more of phpnuke programming but in case there is anybody around here, with a clue on this problem, i definitely would appreciate feed-back.

thanks in advance, Josef