Hi Stephan, At 06:19 PM 12/18/2002, you wrote:
having had the same problem, I wanted to be clever and copied the section from Midgard's root file /usr/lib/apache/midgard-root.php into my .php file:I need to call a dynamic navigation function from a php based community system (phpbb2) [...] plain php file
$midgard = mgd_get_midgard()
Although a call to phpinfo() in my .php file reports the midgard extension to be installed, I still get the MGD_ERR_NOT_CONNECTED you reported.
However, I found a different solution: Rather than trying to initialize Midgard from within a .php file, I require() my .php file from an ordinary Midgard page:
1. Create a new Host with an active Root page and empty style. In my test scenario, this host also has a prefix ('/phptest')
2. In the content of the page, put the line
<?php require(substr($_SERVER['REQUEST_URI'],1)); ?>
3. Make sure to include your document root in your PHP include path
4. Create a directory in your document root in the file system, matching the prefix of your host entry.
5. Now, if you have a file DOCUMENT_ROOT/phptest/tralla.php, you can call it as http://SERVER/phptest/tralla.php
My respective database records are
INSERT INTO host VALUES (122,'SERVER',314,15,'',3,80,1,'/phptest',0);
INSERT INTO page VALUES (314,0,0,'name','title','<?php require(substr($_SERVER[\'REQUEST_URI\'],1)); ?>',1,'active','2003-01-03',0);
Kind regards,
Olav Schettler
contAire GmbH
_____________________________________________
Arndtstr. 12 | D-50676 Cologne | Germany
Phone: +49 (221) 4204757 | Fax: +49 (221) 6060453
Mobil: +49(175)2249141
[EMAIL PROTECTED] | Yahoo! olav
_____________________________________________
Please visit our website http://www.contaire.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
