#!/usr/bin/php (.*?)#', $content, $matches)) { $title = $matches[1]; } $url = $filename; // Strip off my 'static' from the from the front of the URL. Others will probably want to modify this // to suit your own needs $url = str_replace('static/', '', $url); // And remove /index.php from any pages so that it just has a page name with no extension $url = str_replace('/index.php', '', $url); // Remove any PHP code on the page $content = preg_replace('#<\?.*?\?>#s', '', $content); $_POST['post-id'] = $url; $_POST['submitted'] = true; $_POST['post-title'] = $title; $_POST['post-content'] = $content; error_reporting(E_ALL); // finally, run the GetSimple script admin/changedata.php page // The script should basically think that it was posted from the admin // section of the website and do everything that it normally does to // create the page. chdir('admin'); include 'admin/changedata.php'; ?>