Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $host = "localhost";
- $user = "root";
- $password = "";
- $db = "demo";
- session_start();
- $connect = mysqli_connect($host, $user, $password, $db);
- if(isset($_POST['up'])){
- move_uploaded_file($_FILES['file']['tmp_name'],"Imagini/".$_FILES['file']['name']);
- $con = mysqli_connect("localhost","root","","demo");
- $q = mysqli_query($con,"UPDATE users SET Imag = '".$_FILES['file']['name']."' WHERE User = '".$_SESSION['myusername']."'");
- }
- $title="Acasa";
- $content=
- <div id='content_area' align='center'>
- <img src='Imagini/user.png' alt='Avatar' class='avatar' width='250' height='250'/><br>
- <b><font size='5'> ID: ".$_SESSION["myusername"]."</font></b><br><br>
- <form method='post' action='#'>
- <input type='submit' name='up' value='Schimbă Avatarul'/>
- </form>
- <form action='#' method='post' enctype='multipart/form-data'>
- <input type='file' name='file'>
- <input type='submit' name='submit'>
- </form>
- $que='SELECT * FROM loginform';
- $q = mysqli_query($connect,$que);
- while($row = mysqli_fetch_assoc($q)){
- echo $row['User'];
- if($row['Img'] == ""){
- echo "<img width='100' height='100' src='Imagini/user.png' alt='Default Profile Pic'>";
- } else {
- echo "<img width='100' height='100' src='Imagini/".$row['image']."' alt='Profile Pic'>";
- }
- }
- <br>
- <if<br>rame width='560' height='315' src='https://www.youtube.com/embed/zDHieyjwi7g' frameborder='0' allow='autoplay; encrypted-media' allowfullscreen></iframe>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement