0

我想在使用 PHP 和文件输入库进行更新之前从数据库中检索/预览图像。但它无法工作,请给我解决方案。谢谢这里是代码

<body>
    <!-- MAIN -->
    <div class="main">
        <!-- MAIN CONTENT -->
        <div class="main-content">
            <div class="container-fluid">
                <div class="panel panel-profile">
                    <div class="clearfix">
                        <form action="" method="post" enctype="">    
                            <div class="profile-left">
                                <div class="">
                                <div class="file-loading">
                                    <input id="profile_image" type="file" name="profile_image" value="<?php echo $row['image'] ?>" single>
                                </div>
                               </div>
                            </div>
                            <div class="profile-right">
                                <div class="">
                                    <div class="panel-body">
                                        <h4 class="heading">Basic Info</h4>
                                        <ul class="list-unstyled list-justify">
                                            <li>Birthdate <span>24 Aug, 2016</span></li><br/>
                                            <li>Name <span><input class="form-control" name="name" value="<?php echo $row['name'] ?>" type="input"></span></li><br/>
                                            <li>Mobile <span><input class="form-control" name="mobile" value="<?php echo $row['mobile'] ?>" type="input"></span></li><br/>
                                            <li>Email <span><?php echo $row['email'] ?></span></li><br/>
                                            <li>City <span><input class="form-control" name="city" value="<?php echo $row['city'] ?>" type="input"></span></li><br/>
                                            <li>Bank <span><input class="form-control" name="bank" value="<?php echo $row['bank'] ?>" type="input"></span></li>
                                        </ul>
                                    </div>
                                    <div class="text-center"><a href="update_profile.php?id=<?php echo $user_id?>" name="update_profile" class="btn btn-primary">Update Profile</a></div>
                                </div> 
                            </div>    
                        </form>
                    </div>
                </div>
            </div>
        </div>  
    </div>
    <div class="clearfix"></div>
    <footer>
        <div class="container-fluid">
            <p class="copyright">&copy; 2017 <a href="https://www.themeineed.com" target="_blank">Theme I Need</a>. All Rights Reserved.</p>
        </div>
    </footer>
</body>

<script>
   $("#profile_image").fileinput({
       theme: 'fas',
       showUpload: false,
       showCaption: false,
       browseClass: "btn btn-primary btn-lg",
       fileType: "any",
       allowedFileExtensions: ["jpg", "jpeg", "png", "gif"],
       previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
       overwriteInitial: false,
       initialPreviewAsData: true,
       
    
   });
</script>
4

0 回答 0