Variables in external PHP Files
Posted: Thu 3. Jun 2004, 18:00
Hi there,
i was searching for a solution to retrieve Variables in external PHP Files just like {PHP:my_ext.php?var=1} - there is a function in the forum but it messes up with other php includes.
So i have a very quick and very dirty hack:
In the content Element:
[PHP]
$var = 1
$relocate = "my_external.php"
include(relocate);
[/PHP]
IMPORTANT: 'relocate' is a file without file ending in the wcms root with the following content:
<?
include($relocate);
?>
So now, you have the $var available in my_external.php, and in any other external php file namend in $relocate.
Has Anyone another solution for this?
I tried everything, defining $GLOBALS wont work, but maybe I didn´t get the way PHPVAR works ...
Thank you
i was searching for a solution to retrieve Variables in external PHP Files just like {PHP:my_ext.php?var=1} - there is a function in the forum but it messes up with other php includes.
So i have a very quick and very dirty hack:
In the content Element:
[PHP]
$var = 1
$relocate = "my_external.php"
include(relocate);
[/PHP]
IMPORTANT: 'relocate' is a file without file ending in the wcms root with the following content:
<?
include($relocate);
?>
So now, you have the $var available in my_external.php, and in any other external php file namend in $relocate.
Has Anyone another solution for this?
I tried everything, defining $GLOBALS wont work, but maybe I didn´t get the way PHPVAR works ...
Thank you