Ryan
Ryan

Reputation: 3

Php profile upload image

.profile-pic {
    position: absolute;
    border-radius: 50%;
     height: 150px;
    width: 150px;
    left: 20%;
    top: 42%;
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply;
    vertical-align: middle;
    text-align: center;
    color: transparent;
    transition: all .3s ease;
    text-decoration: none;
    cursor: pointer;
}

.profile-pic:hover {
    background-color: rgba(0,0,0,.5);
    z-index: 10000;
    color: #fff;
    transition: all .3s ease;
    text-decoration: none;
}
.profile-pic span {
    display: inline-block;
    padding-top: 4.5em;
    padding-bottom: 4.5em;
}
<form action="upload.php" method="POST" enctype="multipart/form-data">
     <div class="profile-pic" style="background-image: url('https://soygrowers.com/wp-content/uploads/2017/02/default_bio_600x600.jpg')"> 

      <span class="glyphicon glyphicon-camera"></span>
      <span>Change Image</span>
    </div>
  </form>

I'm making a profile page for users and I made my profile picture when i click it it doesn't open image folder. Any help? I just wanna know what I did wrong or not. I'm actually never done something like this before.

Upvotes: 0

Views: 98

Answers (1)

Vijay Arun
Vijay Arun

Reputation: 414

You must include an file input to pick an file.

<div class="profile-pic" onclick="document.getElementById('selectedFile').click();"> 
    <input type="file" id="selectedFile" style="display: none;" />
  <span class="glyphicon glyphicon-camera"></span>
  <span>Change Image</span>
</div>

Upvotes: 1

Related Questions