微擎开发模块调用音频上传案例教程

模块后台

                
{if empty($item['voice'])} {php echo tpl_form_field_audio('voice', '')} {else} {php echo tpl_form_field_audio('voice', $item['voice'])} {/if}

**

PHP代码

       if (checksubmit('submit')) {
            $data = array(
                'title' => trim($_GPC['title']),
                'image' => trim($_GPC['image_voices']),
                'voice' => trim($_GPC['voice']), //这里是重点
                'displayorder' => intval($_GPC['displayorder']),
                'mid' => intval($uid),
            );
            if (!empty($item)) {
                $data['last_time'] = time();
                pdo_update($this->modulename . '_voices', $data, array('id' => $id));
            } else {
                $data['add_time'] = time();
                pdo_insert($this->modulename . '_voices', $data);
            }
            message('操作成功', $url, 'success');
        }

**

你可能感兴趣的:(微擎)