Best way to include a PHP file in a CMS page

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
tonyg

Best way to include a PHP file in a CMS page

Post by tonyg »

Hi all, I have a complex "whois" script that I would like to include inside a CMS page. The script is a form that posts the form results to itself, via an included (INC) file in the PHP script.

I tried putting the standard PHP include statement in a user-defined tag to call whois.php. That displayed the form OK, but when I submit I just get the form again, not the results.

To test what was happening, I created a tag "echo "IP ADDRESS: " . $_SERVER['REMOTE_ADDR'];". What gets returned is the IP address of the shared web server, not the IP address of my domain. I think this is the problem, but I am not sure.

Can anyone tell me if they have had success including a self-posting form in a page? Can it be done with a tag or does it need to be done with a module? If a module, then I'm a bit lost because I've not built one of those yet.

Thanks in advance for the help.

Tony Gilbert
Locked

Return to “CMSMS Core”