field array to use options

I don’t know enough about PHP to do this myself. The code was written for me about three years ago and I’ve not had any luck to contact the guy that did it then.

I would like to be able to have it allow me to have a combo box with out having to type it all in.

The form information is located at the if(SUBDIR == ‘Time’)
There is several other files with this but this is the one I always had to change when adding MySQL database.

If you need any other files I’ll have to send them. The site limits what I can post.
Thank you.

What I would like in the second area of code.
[php]

No Minute Selected 15: Minutes 30: Minutes 45: Minutes On The Hour [/php]

[php]

<?php date_default_timezone_set('UTC'); // Says which errors to report // ini_set('error_reporting', E_ALL); // show errors/warnings/notices // ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_WARNING); // errors only (no notices or warnings) // get the abs path to the directory this config file is in. This is the top level directory to all the code. define('HOME', dirname(realpath(__FILE__))); // top-level scripts like login will not define SUBDIR if(!defined('SUBDIR')) { define('SUBDIR', ''); } AdjustGPC(); // call stripslashes (if need to) on all $_GET/$_POST/$_COOKIE values // this is the date that gets autofilled into add.php // $date_default_timezone_set() $curr_date = date("m/d/Y"); // 05/24/2008 $curr_time = date("h:i A"); // 05:16 PM // Create $fields array and others // don't need to handle username // SUBDIR is also the name of the db table, so avoid funky chars! // assumes 'id' and 'username' are first 2 fields $fields = array(); $fields[] = array('name' => 'id', 'type' => 'varchar', 'len' => 20); // len will not be used, and i know id is not a varchar, // but it can be treated like one $date_selection_fields = array(); $totals_fields = array(); if(SUBDIR == 'Time') { $fields[] = array('name' => 'hour', 'type' => 'varchar', 'len' => 10); $fields[] = array('name' => 'minute', 'type' => 'varchar', 'len' => 10); $fields[] = array('name' => 'day_of_week', 'type' => 'varchar', 'len' => 10); $fields[] = array('name' => 'month', 'type' => 'varchar', 'len' => 10); $fields[] = array('name' => 'email', 'type' => 'varchar', 'len' => 120); $fields[] = array('name' => 'message', 'type' => 'varchar', 'len' => 120); // When this var is set, will enable date selection for the given fields // $date_selection_fields = array('work_date'); } else if(SUBDIR == '') { // top-level scripts. Do nothing } else { // unknown SUBDIR die("SUBDIR[" .SUBDIR . "] not supported\n"); } // Create $field_names $field_names = array(); foreach($fields as $index => $field_info) { $field_names[] = $field_info['name']; } // Create the keyword_fields array. These are the fields that the keyword search will look at $keyword_fields = array(); foreach($fields as $i => $field_info) { $field = $field_info['name']; $type = $field_info['type']; // don't use it if it's the id field, or it's type is not varchar/text (so no date/file_upload) $types = array('varchar', 'text'); if($field != 'id' && in_array($type, $types)) { $keyword_fields[] = $field; } } [/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service