I have created this on registration form. And after submiting want to display in member profile picture. Please need help …
Select your Profile Image:
<form action="<?=base_url()?>home/profile/update_image" method="POST" id="profile_image_form" enctype="multipart/form-data">
<input type="file" style="display: none;" id="profile_image" name="profile_image"/>
</form>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-8 text-right">
<button type="submit" class="btn btn-primary btn-sm btn-labeled fa fa-save"><?=translate('add_member')?></button>
And this is member profile area .
<!-- Profile picture -->
<div class="profile-picture profile-picture--style-2">
<?php
$profile_image = $get_member[0]->profile_image;
$images = json_decode($profile_image, true);
if (file_exists('uploads/profile_image/'.$images[0]['thumb'])) {
?>
<div style="border: 10px solid rgba(255, 255, 255, 0.1);width: 200px;border-radius: 50%;margin-top: 30px;">
<div class="profile_img" id="show_img" style="background-image: url(<?=base_url()?>uploads/profile_image/<?=$images[0]['thumb']?>)"></div>
</div>
<?php
}
else {
?>
<div style="border: 10px solid rgba(255, 255, 255, 0.1);width: 200px;border-radius: 50%;margin-top: 30px;">
<div class="profile_img" id="show_img" style="background-image: url(<?=base_url()?>uploads/profile_image/default_image.png)"></div>
</div>
<?php
}
?>
<div class="profile-connect mt-1 mb-0" id="save_button_section" style="display: none">
<button type="button" class="btn btn-styled btn-xs btn-base-2" id="save_image" ><?php echo translate('save_image')?></button>
</div>
<label class="btn-aux" for="profile_image" style="cursor: pointer;">
<i class="ion ion-edit"></i>
</label>
<form action="<?=base_url()?>home/profile/update_image" method="POST" id="profile_image_form" enctype="multipart/form-data">
<input type="file" style="display: none;" id="profile_image" name="profile_image"/>
</form>
<!-- <a href="#" class="btn-aux">
<i class="ion ion-edit"></i>
</a> -->
</div>
And this is database table:
Name : profile_image
Type : mediumtext
Collation : utf8_general_ci
Null : No
Default : None
Thanks in advance.