Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('config.php');
- session_start();
- if(isset($_POST['submit'])){
- move_uploaded_file($_FILES['file']['tmp_name'],"pictures/".$_FILES['file']['name']);
- mysqli_query($new,"UPDATE users SET picture = '".$_FILES['file']['name']."' WHERE uname = '".$_SESSION['uname']."'");
- }
- if($_SESSION['picture'] == ""){
- echo "<img width='100' height='100' src='pictures/bot.png' alt='Default profile pic'>";
- }else{
- echo "<img width='100' height='100' src='pictures/".$_SESSION['picture']."'>";
- }
- ?>
- <form action="profile.php" method="post" enctype="multipart/form-data">
- <input type="file" name="file"> <button type="submit" name="submit">submit</button>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement