예제 #1
0
echo $SCHEME . '://' . $HOST . $BASE . '/ui/img/background.jpg';
?>
) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;">

<div class="lock-word animated fadeInDown">
</div>
    <div class="middle-box text-center lockscreen animated fadeInDown">
        <div>
            <div class="m-b-md">
            <img alt="image" class="img-circle circle-border" style="width:80%;" src="<?php 
echo $SCHEME . '://' . $HOST . $BASE . '/ui/img/profile.jpg';
?>
">
            </div>
            <h3><?php 
echo randName();
?>
</h3>
            <p>This site require Girudatsu API Key to start a session. Please enter your Girudatsu API Key to start a new session.</p>
            <p>Find it <a target="_blank" href="https://www.facebook.com/groups/Girudatsu.ID/?ref=browser">here</a>.</p>
            <?php 
if (isset($message)) {
    echo $message;
}
?>
            </div>
            
            <form class="m-t" style="width:100%;" method="post" action="<?php 
echo $BASE;
?>
/session">
예제 #2
0
파일: 03.php 프로젝트: xiaoxiaoJun/phpper
			echo '没有文件被上传。';
			break;

		default:;

	}

}

//处理文件过程

$pic = $_FILES['pic'];

//拼接文件路径

$path = './' . mk_dir() . '/' . randName() . '.' . getExt($pic['name']);

//移动
if(move_uploaded_file($pic['tmp_name'], $path)){
	echo '文件成功';
}else{
	echo  '上传失败';
	echo '<pre>';
	print_r($pic);
	echo '</pre>';
}

echo '<h3>程序运行结束!</h3>';


예제 #3
0
 /**
  * Users::updateProfile()
  * 
  * @return
  */
 public function updateProfile()
 {
     Filter::checkPost('fname', Core::$word->UR_FNAME);
     Filter::checkPost('lname', Core::$word->UR_LNAME);
     Filter::checkPost('email', Core::$word->EMAIL);
     Filter::checkPost('address', Core::$word->UR_ADDRESS);
     Filter::checkPost('city', Core::$word->UR_CITY);
     Filter::checkPost('country', Core::$word->UR_COUNTRY);
     Filter::checkPost('state', Core::$word->UR_STATE);
     Filter::checkPost('zip', Core::$word->UR_ZIP);
     if (!$this->isValidEmail($_POST['email'])) {
         Filter::$msgs['email'] = Core::$word->UR_EMAIL_R2;
     }
     if (!empty($_FILES['avatar']['name'])) {
         if (!preg_match("/(\\.jpg|\\.png)\$/i", $_FILES['avatar']['name'])) {
             Filter::$msgs['avatar'] = Core::$word->CG_LOGO_R;
         }
         $file_info = getimagesize($_FILES['avatar']['tmp_name']);
         if (empty($file_info)) {
             Filter::$msgs['avatar'] = Core::$word->CG_LOGO_R;
         }
     }
     $this->verifyCustomFields("profile");
     if (empty(Filter::$msgs)) {
         $data = array('email' => sanitize($_POST['email']), 'lname' => sanitize($_POST['lname']), 'fname' => sanitize($_POST['fname']), 'address' => sanitize($_POST['address']), 'city' => sanitize($_POST['city']), 'country' => sanitize($_POST['country']), 'state' => sanitize($_POST['state']), 'zip' => sanitize($_POST['zip']), 'newsletter' => intval($_POST['newsletter']));
         // Procces Avatar
         if (!empty($_FILES['avatar']['name'])) {
             $thumbdir = UPLOADS;
             $tName = "AVT_" . randName();
             $text = substr($_FILES['avatar']['name'], strrpos($_FILES['avatar']['name'], '.') + 1);
             $thumbName = $thumbdir . $tName . "." . strtolower($text);
             if (Filter::$id && ($thumb = getValueById("avatar", self::uTable, Filter::$id))) {
                 @unlink($thumbdir . $thumb);
             }
             move_uploaded_file($_FILES['avatar']['tmp_name'], $thumbName);
             $data['avatar'] = $tName . "." . strtolower($text);
         }
         $userpass = getValueById("password", self::uTable, $this->uid);
         if ($_POST['password'] != "") {
             $data['password'] = sha1($_POST['password']);
         } else {
             $data['password'] = $userpass;
         }
         $fl_array = array_key_exists_wildcard($_POST, 'custom_*', 'key-value');
         if (isset($fl_array)) {
             $fields = $fl_array;
             $total = count($fields);
             if (is_array($fields)) {
                 $fielddata = '';
                 foreach ($fields as $fid) {
                     $fielddata .= $fid . "::";
                 }
             }
             $data['custom_fields'] = $fielddata;
         }
         self::$db->update(self::uTable, $data, "id=" . $this->uid);
         if (self::$db->affected()) {
             $json['type'] = 'success';
             $json['title'] = Core::$word->SUCCESS;
             $json['message'] = Core::$word->UA_UPDATEOK;
             print json_encode($json);
         } else {
             $json['type'] = 'warning';
             $json['title'] = Core::$word->ALERT;
             $json['message'] = Core::$word->SYSTEM_PROCCESS;
             print json_encode($json);
         }
     } else {
         $json['type'] = 'error';
         $json['title'] = Core::$word->SYSTEM_ERR;
         $json['message'] = Filter::msgSingleStatus();
         print json_encode($json);
     }
 }
예제 #4
0
<?php

header('content-type: text/html; charset=utf-8');
require "./include/init.php";
require_once './include/file.func.tool.php';
$file = $_FILES['upload'];
/*print_r($file);
exit;
*/
if ($file['error'] != 0) {
    echo "文件上传失败!";
    exit;
}
$filedir = './data/uploadfile/';
$path = mk_dir($filedir) . '/' . randName() . '.' . getfileExt($file['name']);
/*print_r($path);
exit;
*/
if (move_uploaded_file($file['tmp_name'], $path)) {
    $msg = "success";
} else {
    echo "文件上传失败,请稍后再试";
    exit;
}
$username = trim($_POST['username']);
// session 隐式传入
$filename = $file['name'];
$filepath = $path;
$uptime = time() + 8 * 3600;
$sql = "insert into files (username, filename, filepath, uptime)" . "values ('{$username}', '{$filename}', '{$filepath}', '{$uptime}')";
if (!mysql_query($sql, $conn)) {
예제 #5
0
파일: 02.php 프로젝트: neilchou/phpbase
/**
 * Array
 * (
 *    [pic] => Array
 *      (
 *           [name] => 1.jpg
 *           [type] => image/jpeg
 *           [tmp_name] => C:\Windows\Temp\php13D4.tmp
 *           [error] => 0
 *           [size] => 6994
 *       )
 *
 * ) 
 */
if ($_FILES['pic']['error'] != 0) {
    echo '文件上传失败';
    exit;
}
$file = $_FILES['pic']['name'];
$tmp_name = $_FILES['pic']['tmp_name'];
$date = date('ymd', time());
$d = './uploads/';
//要上传的目录
$destination = mk_dir($d) . '/' . randName() . '.' . getExt($file);
echo $destination;
$rs = move_uploaded_file($tmp_name, $destination);
if ($rs) {
    echo '文件上传成功';
} else {
    echo '文件上传失败';
}
 /**
  * Users::updateProfile()
  * 
  * @return
  */
 public function updateProfile()
 {
     global $db, $core;
     if (empty($_POST['fname'])) {
         $core->msgs['fname'] = 'Please Enter First Name';
     }
     if (empty($_POST['lname'])) {
         $core->msgs['lname'] = 'Please Enter Last Name';
     }
     if (empty($_POST['email'])) {
         $core->msgs['email'] = 'Please Enter Valid Email Address';
     }
     if (!$this->isValidEmail($_POST['email'])) {
         $core->msgs['email'] = 'Entered Email Address Is Not Valid.';
     }
     if (empty($core->msgs)) {
         $data = array('email' => sanitize($_POST['email']), 'lname' => sanitize($_POST['lname']), 'fname' => sanitize($_POST['fname']), 'newsletter' => intval($_POST['newsletter']));
         $userpass = getValue("password", $this->uTable, "id = '" . $this->uid . "'");
         if ($_POST['password'] != "") {
             $data['password'] = sha1($_POST['password']);
         } else {
             $data['password'] = $userpass;
         }
         // Start Avatar Upload
         include BASEPATH . "lib/class_imageUpload.php";
         include BASEPATH . "lib/class_imageResize.php";
         $newName = "IMG_" . randName();
         $ext = substr($_FILES['avatar']['name'], strrpos($_FILES['avatar']['name'], '.') + 1);
         $name = $newName . "." . strtolower($ext);
         $als = new Upload();
         $als->File = $_FILES['avatar'];
         $als->method = 1;
         $als->SavePath = UPLOADS;
         $als->NewWidth = $core->thumb_w;
         $als->NewHeight = $core->thumb_h;
         $als->NewName = $newName;
         $als->OverWrite = true;
         $err = $als->UploadFile();
         $avatar = getValue("avatar", $this->uTable, "id = '" . $this->uid . "'");
         if (!empty($_FILES['avatar']['name'])) {
             if ($avatar) {
                 @unlink($als->SavePath . $avatar);
             }
             $data['avatar'] = $name;
         } else {
             $data['avatar'] = $avatar;
         }
         if (count($err) > 0 and is_array($err)) {
             foreach ($err as $key => $val) {
                 $core->msgError($val, false);
             }
         }
         $db->update($this->uTable, $data, "id='" . (int) $this->uid . "'");
         $db->affected() ? $core->msgOk('<span>Success!</span> You have successfully updated your profile.') : $core->msgAlert('<span>Alert!</span>Nothing to process.');
     } else {
         print $core->msgStatus();
     }
 }
예제 #7
0
 /**
  * Content::processField()
  * 
  * @return
  */
 public function processField()
 {
     Filter::checkPost('title', Core::$word->CF_TTITLE);
     if (empty(Filter::$msgs)) {
         $data = array('title' => sanitize($_POST['title']), 'tooltip' => sanitize($_POST['tooltip']), 'req' => intval($_POST['req']), 'active' => intval($_POST['active']), 'type' => sanitize($_POST['type']));
         if (!Filter::$id) {
             $data['name'] = sanitize($_POST['type']) . randName(2);
         }
         Filter::$id ? Registry::get("Database")->update(self::fTable, $data, "id=" . Filter::$id) : Registry::get("Database")->insert(self::fTable, $data);
         $message = Filter::$id ? Core::$word->CF_UPDATED : Core::$word->CF_ADDED;
         if (self::$db->affected()) {
             $json['type'] = 'success';
             $json['title'] = Core::$word->SUCCESS;
             $json['message'] = $message;
             print json_encode($json);
         } else {
             $json['type'] = 'warning';
             $json['title'] = Core::$word->ALERT;
             $json['message'] = Core::$word->SYSTEM_PROCCESS;
             print json_encode($json);
         }
     } else {
         $json['type'] = 'error';
         $json['title'] = Core::$word->SYSTEM_ERR;
         $json['message'] = Filter::msgSingleStatus();
         print json_encode($json);
     }
 }