A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_URI::$config is deprecated
Filename: core/URI.php
Line Number: 101
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Router::$uri is deprecated
Filename: core/Router.php
Line Number: 127
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$log is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$benchmark is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$hooks is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$config is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$utf8 is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$uri is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$exceptions is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$router is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$output is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$security is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$input is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$lang is deprecated
Filename: core/Controller.php
Line Number: 75
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$load is deprecated
Filename: core/Controller.php
Line Number: 78
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$db is deprecated
Filename: core/Loader.php
Line Number: 396
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_DB_mysqli_driver::$failover is deprecated
Filename: database/DB_driver.php
Line Number: 371
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 132
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 292
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 166
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 235
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 315
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Return type of CI_Session_files_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 356
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$session is deprecated
Filename: core/Loader.php
Line Number: 1283
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$form_validation is deprecated
Filename: core/Loader.php
Line Number: 1283
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 8
Function: __construct
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property Circle::$m_data is deprecated
Filename: core/Loader.php
Line Number: 358
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 10
Function: model
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$log is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$benchmark is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$hooks is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$config is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$utf8 is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$uri is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$exceptions is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$router is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$output is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$security is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$input is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$lang is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$load is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$db is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$session is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$form_validation is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
A PHP Error was encountered
Severity: 8192
Message: Creation of dynamic property CI_Loader::$m_data is deprecated
Filename: core/Loader.php
Line Number: 931
Backtrace:
File: /home/u7641530/public_html/malasngoding.com/cicore/application/controllers/Circle.php
Line: 502
Function: view
File: /home/u7641530/public_html/malasngoding.com/index.php
Line: 326
Function: require_once
Cara Delete / Unlink File Lama Dalam Folder Assets Codeigniter- Circle
Cara Delete / Unlink File Lama Dalam Folder Assets Codeigniter
Mohon bantuannya, setelah saya berhasil melakukan upload dan update gambar baru, file yang lama masih ada dalam folder assets padahal sudah pakai unlink tapi tetap gk ada efek di file tersebut
ini Controllernya:
public function det_dosen()
{
if($this->session->userdata('akses') =='1'){
$id_login = $this->input->post('id_login');
$prodi = $this->input->post('prodi');
$jenjang = $this->input->post('jenjang');
$ttl = $this->input->post('ttl');
$email = $this->input->post('email');
$notelp = $this->input->post('no_telp');
$alamat = $this->input->post('alamat');
$foto = $_FILES['fotopost ']['name'];
$old = $this->input->post('fotolama');
if (empty($foto)){
$config['upload_path'] = './assets/img/profile';
$config['allowed_types'] = 'jpg|png|jpeg';
$config['max_size'] = 2048;
$this->load->library('upload',$config);
$this->upload->initialize($config);
if(!$this->upload->do_upload('fotopost')){
echo $this->upload->display_errors(); die();
}
else{
$foto = $this->upload->data('file_name');
}
$data = array(
'prodi' => $prodi,
'jenjang_pend' => $jenjang,
'alamat' => $alamat,
'ttl' => $ttl,
'no_telp' => $notelp,
'email' => $email,
'profile' => $foto
);
$this->m_admin->input_detdosen($id_login, $data);
}
else{
$config['upload_path'] = './assets/img/profile';
$config['allowed_types'] = 'jpg|png|jpeg';
$config['max_size'] = 2048;
$this->load->library('upload',$config);
$this->upload->initialize($config);
if(!$this->upload->do_upload('fotopost')){
echo $this->upload->display_errors(); die();
}
else{
$foto = $this->upload->data('file_name');
}
$data = array(
'prodi' => $prodi,
'jenjang_pend' => $jenjang,
'alamat' => $alamat,
'ttl' => $ttl,
'no_telp' => $notelp,
'email' => $email,
'profile' => $foto
);
$path = './assets/img/profile/'.$old;
unlink($path);
$this->m_admin->input_detdosen($id_login, $data);
}
redirect('admin/show_dosen/'.$id_login);
}else{
redirect('login');
}
}
Dan ini Model:
function input_detdosen($id_login, $data){
$this->db->where('id_login',$id_login);
return $this->db->update('data_dosen', $data);
}
Input di index:
<input type="hidden" name="fotolama" value="<?php echo $ds['profile'];?>">
<input type="file" name="fotopost" class="form-control">
2 Jawaban
coba kasih chmod dulu file yang mau dihapus
misalnya
$path = './assets/img/profile/'.$old;
chmod($path, 0777);
unlink($path);
0
dia gak mau delete karna ada spasi saat unlink coba di hilangin dulu pake trim
ini jalan kalau buat saya , codeigniter 3
$old = trim($this->input->post('fotolama'));
1
Silahkan
Login untuk menjawab.