本文整理汇总了PHP中FileUpload::move_file方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUpload::move_file方法的具体用法?PHP FileUpload::move_file怎么用?PHP FileUpload::move_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUpload
的用法示例。
在下文中一共展示了FileUpload::move_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
$profile_status_pic = $profile_data['userPic'];
$profile_fullname = $profile_first_name . " " . $profile_last_name;
}
$query = "SELECT user_id, albumId, albumname \n\t\t\t\t\tFROM photoalbum \n\t\t\t\t\tWHERE user_id = {$profileid}\n\t\t\t\t\tAND albumId={$albumid}";
$result_set = mysql_query($query, $tbconnection);
while ($album_data = mysql_fetch_array($result_set)) {
$album_name = $album_data['albumname'];
}
if (isset($_POST['submit'])) {
//$_FILES[] upload script
$image_fieldname = "file_upload";
$tmp_file = $_FILES[$image_fieldname]['tmp_name'];
$target_file = time() . "-" . basename($_FILES[$image_fieldname]['name']);
$upload_dir = "assets/images/uploads/albums/albumid{$albumid}";
$file_upload = new FileUpload($tmp_file, $target_file, $upload_dir, $image_fieldname);
$message = $file_upload->move_file();
$photofilename = $target_file;
$photodesc = trim(mysql_real_escape_string($_POST['desc']));
$query = "INSERT INTO photos (album_id, user_id, photoFname, description) VALUES ({$albumid},{$profileid},'{$photofilename}','{$photodesc}')";
$result_set = mysql_query($query, $tbconnection);
if ($result_set) {
//redirect to relevant photoalbum.php file*/
redirect_to("photoalbum.php?profileid={$profileid}&albumid={$albumid}");
} else {
$sql_error = "Did nto update database" . mysql_error();
}
}
?>
<!DOCTYPE html>
<head>