[pmwiki-users] Creating pages from other PHP script

Peter Bowers pbowers at pobox.com
Fri Jun 18 01:47:35 CDT 2010


On Fri, Jun 18, 2010 at 6:43 AM, Wordit Ltd <wordituk at googlemail.com> wrote:
> I would like another PHP application to export content to pmwiki by
> creating pages, and/or editing pages. So via scripts on the same
> server.

I believe you could have a script like this:

===(snip)===
<?php

$EnableActions = 0;
$pagename = 'SomeGroup.SomePage';

include_once('pmwiki.php');

$page['text'] = 'the new text I want on a page';
$page['anyotherattribute'] = 'some value';

if (!UpdatePage($pn, array(), $page)) {
   // handle an error
}
===(snip)===

Basically it gives you all the internals of pmwiki without pmwiki
actually doing anything.

There may well be other variables besides $pagename that you would
need to set -- perhaps required variables in $_REQUEST like ['n'] or
somesthing?

I note I've never tried this so hopefully I'm not leading you down a bad path...

-Peter



More information about the pmwiki-users mailing list