X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=metaform.php;h=03d8b2863b2ec80938bd3ec3b95d4bc918525fb3;hb=409b78be52f7a934a0cbfe0d927b7e0b42d60ec4;hp=82637970b03d73e18438d42e47c38699295abbf3;hpb=22d5fb7ab7d4ee86bd59e194387dca268bd577a1;p=wfpl.git diff --git a/metaform.php b/metaform.php index 8263797..03d8b28 100644 --- a/metaform.php +++ b/metaform.php @@ -22,6 +22,7 @@ # This file writes the code for you (sql, php, html, email) to handle a form. require_once('code/wfpl/template.php'); +require_once('code/wfpl/http.php'); require_once('code/wfpl/tar.php'); # see code/wfpl/metaform/template.html for the html templates for these elements @@ -231,9 +232,18 @@ function make_php() { $tem->set('always_field', $always_field); $tem->set('db_fields', $db_fields); $tem->set('php_fields', $php_fields); + $tem->set('metaform_url', edit_url()); return $tem->run(); } +# make a URL for the edit page with all the fields filled in +function edit_url() { + $url = this_url(); + $url = ereg_replace('view_php=[^&]*', 'edit=yes', $url); + $url = ereg_replace('download_tar=[^&]*', 'edit=yes', $url); + return $url; +} + function view_php() { view_headers(); echo make_php();