本文整理匯總了PHP中Avatar::move方法的典型用法代碼示例。如果您正苦於以下問題:PHP Avatar::move方法的具體用法?PHP Avatar::move怎麽用?PHP Avatar::move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Avatar
的用法示例。
在下文中一共展示了Avatar::move方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Avatar
}
if (empty($_POST['email'])) {
$Empty[] = 'email';
}
if (empty($_POST['description'])) {
$Empty[] = 'description';
}
if (long2ip(ip2long($_SERVER['REMOTE_ADDR'])) != $_SERVER['REMOTE_ADDR']) {
echo 'Your IP address is not valid. ';
die;
}
if (!empty($_FILES['picture']['tmp_name'])) {
require 'inc/Avatar.php';
$Picture = new Avatar();
$picture_name = md5(time() . rand(0, 999));
if (!$Picture->move($_FILES['picture']['tmp_name'], $picture_name)) {
$Invalid['picture'] = 'Something went wrong. Allowed images are JPG, GIF, PNG and max file size is 6 MB. Also note that there is a max width and height on 5000 pixels.';
$picture_name = NULL;
}
} else {
$picture_name = NULL;
}
if (sizeof($Empty) == 0) {
if (!is_numeric($_POST['lon'])) {
$Invalid['lon'] = 'Failed to match a correct longitude pattern';
}
if (!is_numeric($_POST['lat'])) {
$Invalid['lat'] = 'Failed to match a correct latitude pattern';
}
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$Invalid['email'] = 'Invalid E-mail address';