클래스의 class.upload.php 변수의 사전 옵션을 사용하고 싶습니다. 모든 업로드 페이지에서 설정을 반복하고이 변수를 모두 변경해야한다면 약간의 변경을해야 할 때 변수 나 함수 또는 구문으로이 선행 옵션을 추가 할 수있는 솔루션이 필요합니다.클래스에서 전역 변수를 사용하는 방법
if ((isset($_POST['actionmanset']) ? $_POST['actionmanset'] : (isset($_GET['actionmanset']) ? $_GET['actionmanset'] : '')) == 'manset')
{
$handle = new Upload($_FILES['resim']);
if ($handle->uploaded) {
//common variables i want to use start
$handle->auto_create_dir = FALSE;
$handle->file_max_size = '5000000'; // 4mb
$handle->mime_check = TRUE; #Güvenlik
$handle->allowed = array('image/jpeg','image/gif','image/png'); #Güvenlik Yalnız resim
$handle->no_script = true; #güvenlik
$handle->image_resize = true;
$handle->image_ratio_crop = true;
$handle->file_auto_rename = true;
$handle->file_name_body_pre = 'tt_';
//common variables i want to use finish
$handle->image_x = 427;
$handle->image_y = 225;
$handle->Process('../uploads/manset/');
if ($handle->processed) { $mansetresmi=$handle->file_dst_name;}
}
}
어떻게이 전역 변수를 모든 내 페이지에서 다시 사용할 수 있습니까?
//common variables i want to use start $handle->auto_create_dir = FALSE; $handle->file_max_size = '5000000'; // 4mb $handle->mime_check = TRUE; #Güvenlik $handle->allowed = array('image/jpeg','image/gif','image/png'); #Güvenlik Yalnız resim $handle->no_script = true; #güvenlik $handle->image_resize = true; $handle->image_ratio_crop = true; $handle->file_auto_rename = true; $handle->file_name_body_pre = 'tt_'; //common variables i want to use finish
을 반환 할 수 있습니다 필드 선언을 변경하고 페이지를 다시 정의해야합니다. –
class.upload.php라는 클래스와 upload.php라는 파일이 있으므로 _construct, class 또는 file을 추가해야합니다. – Bagova
'클래스 업로드 '를 정의하는 파일은 무엇입니까? –