X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=metaform%2Ftemplate.php;h=14836c777594093fdd01bc038fd132b34b2d4c26;hb=cf7a90640ded556566c93932c4c56c1c7a1ffdae;hp=adf48037fc47376b67d133033e959b32f6cad04a;hpb=53094de20d007b5a121f8a7cf814eabd8ee75b90;p=wfpl.git diff --git a/metaform/template.php b/metaform/template.php index adf4803..14836c7 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -32,7 +32,6 @@ require_once('code/wfpl/db.php'); require_once('code/wfpl/upload.php'); function ~form_name~_get_fields() { - $fields = array(); $~name~ = format_~format~($_REQUEST['~name~']); $~name~ = save_uploaded_image('~name~', $GLOBALS['upload_directory']); @@ -72,8 +71,12 @@ function ~form_name~() { if("you're happy with the POSTed values") { # to enable saving to a database, create a file called 'db_connect.php' # see: code/wfpl/examples/db_connect.php - if(file_exists('db_connect.php')) { - require_once('db_connect.php'); + if(file_exists('db_connect.php') || file_exists('code/db_connect.php')) { + if(file_exists('db_connect.php') { + require_once('db_connect.php'); + } else { + require_once('code/db_connect.php'); + } if($edit_id) { # uploading nothing means leaving it as is. if(!$~name~ && $delete_~name~ != 'Yes') {