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


PHP CommonController::uploadImageFile方法代码示例

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


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

示例1:

 $userCount = mysql_num_rows($uniqueResult);
 if ($userCount == 0) {
     $flag = 1;
 } else {
     $flag = 0;
     $msg = 'Username, Email and Contact must be unique.';
     $class = 'danger';
 }
 if ($flag) {
     $uploadFlag = 1;
     $data['firstname'] = $_POST['txtFirstname'];
     $data['lastname'] = $_POST['txtLastname'];
     $data['username'] = $_POST['txtUsername'];
     $data['email'] = $_POST['txtEmail'];
     if (!empty($_FILES['fileImage']['name'])) {
         $uploadImage = $commonController->uploadImageFile($_FILES['fileImage'], '../images/users/');
         if ($uploadImage['status'] == 1) {
             $data['image'] = $uploadImage['message'];
         } else {
             $uploadFlag = 0;
             $msg = $uploadImage['message'];
         }
     }
     $data['address'] = $_POST['txtAddress'];
     $data['contact'] = $_POST['txtContact'];
     $data['type'] = $userType;
     $data['status'] = $_POST['rdoStatus'];
     $data['city_id'] = $_POST['ddlCity'];
     $data['country_id'] = $_POST['ddlCountry'];
     $data['state_id'] = $_POST['ddlState'];
     $data['district_id'] = $_POST['ddlDistrict'];
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:add_edit_users.php

示例2: sprintf

 $data['facebook_url'] = !empty($_POST['txtFacebookUrl']) ? FACEBOOK_URL . $_POST['txtFacebookUrl'] : '';
 $data['twitter_url'] = !empty($_POST['txtTwitterUrl']) ? TWITTER_URL . $_POST['txtTwitterUrl'] : '';
 $data['check_in'] = sprintf('%s', $_POST['txtCheckIn']);
 $data['check_out'] = sprintf('%s', $_POST['txtCheckOut']);
 $data['deals'] = $_POST['ddlRoomDeal'];
 if (!empty($_POST['txtStartTime']) && !empty($_POST['txtEndTime'])) {
     $data['sms_time'] = sprintf('%s-%s', $_POST['txtStartTime'], $_POST['txtEndTime']);
 }
 if (!empty($_POST['hdnId'])) {
     $data['id'] = $_POST['hdnId'];
     $data['updated_date'] = date('Y-m-d h:i:s');
 } else {
     $data['created_date'] = date('Y-m-d h:i:s');
 }
 if (!empty($_FILES['fileImage']['name'])) {
     $uploadImage = $commonController->uploadImageFile($_FILES['fileImage'], 'images/listings/');
     if ($uploadImage['status'] == 1) {
         $data['logo'] = $uploadImage['message'];
     } else {
         $uploadFlag = 0;
         $msg = $uploadImage['message'];
     }
 }
 if ($data['name'] != $_POST['hdnName'] && $adminController->checkRecordUniqueNess(array('table' => $data['table'], 'column' => 'name', 'value' => $data['name'])) == 0) {
     $flag = 1;
 } else {
     if ($data['name'] == $_POST['hdnName']) {
         $flag = 1;
     } else {
         $flag = 0;
         $msg = 'Name must be unique.';
开发者ID:aniketbasu14,项目名称:snoozeover,代码行数:31,代码来源:1add_edit_establishments.php


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