Hi all,
Maybe this question is naïve. I am trying to write a module. The proper module just includes a main php script. In that main file, I want to invoke another php script.
My problem is that this script knows nothing about the variables which are available in the module. How can that be done? I would prefer not to use a submit button.
module:
$basePath = $modx->config['base_path'];
//$modPath comes from the module configuration
include($basePath . $modPath . "main.php");
main.php
<http>
<head>
...
</head>
<body>
...
I want, for example, this link to execute: <a href="script.php" >do something</a>
...
</body>
</html>
script.php:
<?php
//make an sql query
//render the results in a table
include $basePath . $modPath . "maketable.class.php";
//etc
?>
The logs say:
... Undefined variable: modPath ...
... Undefined variable: basePath ...
Thanks!
João