I need to upload a profile picture of the user those who are registering. I had uploaded and stored the url of that profile picture in my DB. Now, I need to show that image from that image url. I had done the below code. But it's not working. echo 'echo '<img src= "<?php echo $location; ?>">';
$up=move_uploaded_file($_FILES['profile']'tmp_name'],dirname($_SERVER['DOCUMENT_ROOT']).'/htdocs/upload/image/'.$name);
$path = dirname($_SERVER['DOCUMENT_ROOT']).'/htdocs/upload/image/';
$location = $path . $_FILES['profile']['name'];
$ins=mysqli_query($con, "INSERT into image (url) values ('$location')"); echo '<img src= "'.$location.'"/>'
$location is the variable where i saved the image url.
echo '<img src= "'.$location.'"/>';
echo "<img src='$location'>";