当前位置: 首页>>代码示例>>PHP>>正文


PHP upload::errmsg方法代码示例

本文整理汇总了PHP中upload::errmsg方法的典型用法代码示例。如果您正苦于以下问题:PHP upload::errmsg方法的具体用法?PHP upload::errmsg怎么用?PHP upload::errmsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在upload的用法示例。


在下文中一共展示了upload::errmsg方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveupload

 public function saveupload()
 {
     $json = new Services_JSON();
     $uploadpath = 'upload/goods/';
     $filepath = '/upload/goods/';
     $upload = new upload($uploadpath, array('gif', 'jpg', 'jpge', 'png'));
     //upload
     $file = $upload->getfile();
     if ($upload->errno != 15 && $upload->errno != 0) {
         $msg = $json->encode(array('error' => 1, 'message' => $upload->errmsg()));
     } else {
         $msg = $json->encode(array('error' => 0, 'url' => $filepath . $file[0][saveName], 'trueurl' => $upload->returninfo['name']));
     }
     echo $msg;
     exit;
 }
开发者ID:snamper,项目名称:xiaoshuhaochi,代码行数:16,代码来源:adminmethod.php

示例2: goodsupload

 function goodsupload()
 {
     $link = IUrl::creatUrl('member/login');
     if ($this->member['uid'] == 0 && $this->admin['uid'] == 0) {
         $this->message('未登陆', $link);
     }
     $type = IReq::get('type');
     $goodsid = intval(IReq::get('goodsid'));
     $shopid = ICookie::get('adminshopid');
     if ($shopid < 0) {
         echo '无权限操作';
         exit;
     }
     if (is_array($_FILES) && isset($_FILES['imgFile'])) {
         $json = new Services_JSON();
         $uploadpath = 'upload/shop/';
         $filepath = '/upload/shop/';
         $upload = new upload($uploadpath, array('gif', 'jpg', 'jpge', 'doc', 'png'));
         //upload
         $file = $upload->getfile();
         if ($upload->errno != 15 && $upload->errno != 0) {
             echo "<script>parent.uploaderror('" . json_encode($upload->errmsg()) . "');</script>";
         } else {
             if ($goodsid > 0 && $shopid > 0) {
                 $data['img'] = $filepath . $file[0]['saveName'];
                 $this->mysql->update(Mysite::$app->config['tablepre'] . 'goods', $data, "id='" . $goodsid . "' and shopid='" . $shopid . "'");
             }
             echo "<script>parent.uploadsucess('" . $filepath . $file[0]['saveName'] . "');</script>";
         }
         exit;
     }
     $imgurl = '';
     if ($goodsid > 0 && $type == 'goods') {
         $temp = $this->mysql->select_one("select img from " . Mysite::$app->config['tablepre'] . "goods where id='" . $goodsid . "' and shopid='" . $shopid . "'");
         $imgurl = $temp['img'];
     }
     Mysite::$app->setdata(array('type' => $type, 'goodsid' => $goodsid, 'imgurl' => $imgurl));
 }
开发者ID:snamper,项目名称:xiaoshuhaochi,代码行数:38,代码来源:method.php

示例3: strtotime

 /*文件上传处理程序*/
 $file = $_FILES['fileField'];
 $attachurl = '';
 if ($file['size'] > 0) {
     $fileArr['file'] = $file['tmp_name'];
     $fileArr['name'] = $file['name'];
     $fileArr['size'] = $file['size'];
     $fileArr['type'] = $file['type'];
     $file_name = 'f' . mt_rand(100, 999) . strtotime(date('Y-m-d H:i:s', time())) . strtolower(strrchr($file['name'], "."));
     $filetypes = explode(' ', $webdb[upfileType]);
     $savepath = "../upload_files/guestbook/";
     $maxsize = 0;
     $overwrite = 0;
     $upload = new upload($fileArr, $file_name, $savepath, $filetypes, $overwrite, $maxsize);
     if (!$upload->run()) {
         showerr($upload->errmsg());
     }
     $attachurl = "guestbook/" . $file_name;
 }
 $db->query("INSERT INTO `{$_pre}content` ( `ico` , `email` , `oicq` , `weburl` , `blogurl` , `uid` , `username` , `ip` , `content` , `yz` , `posttime` , `list`, `fid`, `mobphone`, `companyname`, `truename`, `phone`, `deadline`, `attach1`, `attach2`, `attach3`, `attachurl`, `ofid`, `aid` , `goods_num`, `goods_spe`, `goods_remark`)\n\tVALUES (\n\t'{$face}','{$postdb['email']}','{$postdb['oicq']}','{$postdb['weburl']}','{$postdb['blogurl']}','{$lfjuid}','{$postdb['username']}','{$onlineip}','{$postdb['content']}','{$yz}','{$timestamp}','{$timestamp}','{$fid}','{$postdb['mobphone']}','{$postdb['companyname']}','{$postdb['truename']}','{$postdb['phone']}','{$postdb['deadline']}','{$postdb['attach1']}','{$postdb['attach2']}','{$postdb['attach3']}','{$attachurl}','{$postdb['ofid']}','{$postdb['aid']}','{$postdb['goods_num']}','{$postdb['goods_spe']}','{$postdb['goods_remark']}')\n\t");
 /*发送邮件程序*/
 require_once 'phpmailer/class.phpmailer.php';
 $content .= "公司名称:" . $postdb[companyname] . "<br>联系人:" . $postdb[truename] . "<br>电子邮件:" . $postdb[email] . "<br>联系电话:" . $postdb[phone] . "<br>交货期:" . $postdb[deadline] . "<br>commodity code:" . $postdb[goods_sn] . "<br>name of commodity:" . $postdb[title] . "<br>number:" . $postdb[goods_num] . "<br>specification:" . $postdb[goods_spe] . "<br>remarks:" . $postdb[goods_remark] . "<br>询价中需要说明的要求1:" . $postdb[attach1] . "<br>询价中需要说明的要求2:" . $postdb[attach2] . "<br>询价中需要说明的要求3:" . $postdb[attach3];
 $content = iconv('GBK', 'UTF-8', $content);
 send_email($content);
 $rurl = "?fid={$fid}";
 if ($postdb[ofid]) {
     $rurl .= "&ofid={$ofid}";
 }
 if ($postdb[aid]) {
     $rurl .= "&aid={$aid}";
开发者ID:GHubgenius,项目名称:qbbj,代码行数:31,代码来源:index.php


注:本文中的upload::errmsg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。