PHP Database how to display image on a different html page









up vote
-1
down vote

favorite












I have setup an Image database which can add/update/delete images from the database, But I am stuck on trying to display these images on a separate page. Any help would be greatly appreciated



Picture of page where i can add/update/delete images



This is my html code which lets me add/update/delete photos



<?php
if (isset($_POST['edit']))
require 'header.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Image Uploader</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<br /><br />
<div class="container" style="width:900px;">
<h3 align="center">Image Uploader</h3>
<br />
<div align="right">
<button type="button" name="add" id="add" class="btn btn-success">Add</button>
</div>
<br />
<div id="image_data">

</div>
</div>
</body>
</html>

<div id="imageModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Add Image</h4>
</div>
<div class="modal-body">
<form id="image_form" method="post" enctype="multipart/form-data">
<p><label>Select Image</label>
<input type="file" name="image" id="image" /></p><br />
<input type="hidden" name="action" id="action" value="insert" />
<input type="hidden" name="image_id" id="image_id" />
<input type="submit" name="insert" id="insert" value="Insert" class="btn btn-info" />

</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

<script>
$(document).ready(function()

fetch_data();

function fetch_data()

var action = "fetch";
$.ajax(
url:"action.php",
method:"POST",
data:action:action,
success:function(data)

$('#image_data').html(data);

)

$('#add').click(function()
$('#imageModal').modal('show');
$('#image_form')[0].reset();
$('.modal-title').text("Add Image");
$('#image_id').val('');
$('#action').val('insert');
$('#insert').val("Insert");
);
$('#image_form').submit(function(event)
event.preventDefault();
var image_name = $('#image').val();
if(image_name == '')

alert("Please Select Image");
return false;

else

var extension = $('#image').val().split('.').pop().toLowerCase();
if(jQuery.inArray(extension, ['gif','png','jpg','jpeg']) == -1)

alert("Invalid Image File");
$('#image').val('');
return false;

else

$.ajax(
url:"action.php",
method:"POST",
data:new FormData(this),
contentType:false,
processData:false,
success:function(data)

alert(data);
fetch_data();
$('#image_form')[0].reset();
$('#imageModal').modal('hide');

);


);
$(document).on('click', '.update', function()
$('#image_id').val($(this).attr("id"));
$('#action').val("update");
$('.modal-title').text("Update Image");
$('#insert').val("Update");
$('#imageModal').modal("show");
);
$(document).on('click', '.delete', function()
var image_id = $(this).attr("id");
var action = "delete";
if(confirm("Are you sure you want to remove this image from database?"))

$.ajax(
url:"action.php",
method:"POST",
data:image_id:image_id, action:action,
success:function(data)

alert(data);
fetch_data();

)

else

return false;

);
);
</script>

<?php

else
header("Location: index.php");
exit();



?>


This is the php code



<?php
//action.php
if(isset($_POST["action"]))

$connect = mysqli_connect("localhost", "Marcus", "1234", "loginsystem");
if($_POST["action"] == "fetch")

$query = "SELECT * FROM images ORDER BY id DESC";
$result = mysqli_query($connect, $query);
$output = '
<table class="table table-bordered table-striped">
<tr>
<th width="10%">ID</th>
<th width="70%">Image</th>
<th width="10%">Change</th>
<th width="10%">Remove</th>
</tr>
';
while($row = mysqli_fetch_array($result))

$output .= '

<tr>
<td>'.$row["id"].'</td>
<td>
<img src="data:image/jpeg;base64,'.base64_encode($row['name'] ).'" height="60" width="75" class="img-thumbnail" />
</td>
<td><button type="button" name="update" class="btn btn-warning bt-xs update" id="'.$row["id"].'">Change</button></td>
<td><button type="button" name="delete" class="btn btn-danger bt-xs delete" id="'.$row["id"].'">Remove</button></td>
</tr>
';

$output .= '</table>';
echo $output;


if($_POST["action"] == "insert")

$file = addslashes(file_get_contents($_FILES["image"]["tmp_name"]));
$query = "INSERT INTO images(name) VALUES ('$file')";
if(mysqli_query($connect, $query))

echo 'Image Inserted into Database';


if($_POST["action"] == "update")

$file = addslashes(file_get_contents($_FILES["image"]["tmp_name"]));
$query = "UPDATE images SET name = '$file' WHERE id = '".$_POST["image_id"]."'";
if(mysqli_query($connect, $query))

echo 'Image Updated into Database';


if($_POST["action"] == "delete")

$query = "DELETE FROM images WHERE id = '".$_POST["image_id"]."'";
if(mysqli_query($connect, $query))

echo 'Image Deleted from Database';



?>









share|improve this question







New contributor




marcus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • "But I am stuck on trying to display" - where exactly? What is the problem?
    – Jeff
    17 hours ago










  • I am trying to display the images seen in the picture i attached on a separate page
    – marcus
    17 hours ago










  • Display where? What's your attempted code of the display page?
    – Edwin Krause
    17 hours ago










  • On a separate page, and I have tried to use my function i created but it didn't work so i deleted it. here is part of my index.php code i want the pictures to be displayed at.
    – marcus
    17 hours ago










  • <img class="block" id="u252_img" src="images/drake_photo_by_prince_williams_wireimage_getty_479503454.jpg?crc=3816007144" alt="" data-heightwidthratio="1" data-image-width="260" data-image-height="260"/>
    – marcus
    17 hours ago














up vote
-1
down vote

favorite












I have setup an Image database which can add/update/delete images from the database, But I am stuck on trying to display these images on a separate page. Any help would be greatly appreciated



Picture of page where i can add/update/delete images



This is my html code which lets me add/update/delete photos



<?php
if (isset($_POST['edit']))
require 'header.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Image Uploader</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<br /><br />
<div class="container" style="width:900px;">
<h3 align="center">Image Uploader</h3>
<br />
<div align="right">
<button type="button" name="add" id="add" class="btn btn-success">Add</button>
</div>
<br />
<div id="image_data">

</div>
</div>
</body>
</html>

<div id="imageModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Add Image</h4>
</div>
<div class="modal-body">
<form id="image_form" method="post" enctype="multipart/form-data">
<p><label>Select Image</label>
<input type="file" name="image" id="image" /></p><br />
<input type="hidden" name="action" id="action" value="insert" />
<input type="hidden" name="image_id" id="image_id" />
<input type="submit" name="insert" id="insert" value="Insert" class="btn btn-info" />

</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

<script>
$(document).ready(function()

fetch_data();

function fetch_data()

var action = "fetch";
$.ajax(
url:"action.php",
method:"POST",
data:action:action,
success:function(data)

$('#image_data').html(data);

)

$('#add').click(function()
$('#imageModal').modal('show');
$('#image_form')[0].reset();
$('.modal-title').text("Add Image");
$('#image_id').val('');
$('#action').val('insert');
$('#insert').val("Insert");
);
$('#image_form').submit(function(event)
event.preventDefault();
var image_name = $('#image').val();
if(image_name == '')

alert("Please Select Image");
return false;

else

var extension = $('#image').val().split('.').pop().toLowerCase();
if(jQuery.inArray(extension, ['gif','png','jpg','jpeg']) == -1)

alert("Invalid Image File");
$('#image').val('');
return false;

else

$.ajax(
url:"action.php",
method:"POST",
data:new FormData(this),
contentType:false,
processData:false,
success:function(data)

alert(data);
fetch_data();
$('#image_form')[0].reset();
$('#imageModal').modal('hide');

);


);
$(document).on('click', '.update', function()
$('#image_id').val($(this).attr("id"));
$('#action').val("update");
$('.modal-title').text("Update Image");
$('#insert').val("Update");
$('#imageModal').modal("show");
);
$(document).on('click', '.delete', function()
var image_id = $(this).attr("id");
var action = "delete";
if(confirm("Are you sure you want to remove this image from database?"))

$.ajax(
url:"action.php",
method:"POST",
data:image_id:image_id, action:action,
success:function(data)

alert(data);
fetch_data();

)

else

return false;

);
);
</script>

<?php

else
header("Location: index.php");
exit();



?>


This is the php code



<?php
//action.php
if(isset($_POST["action"]))

$connect = mysqli_connect("localhost", "Marcus", "1234", "loginsystem");
if($_POST["action"] == "fetch")

$query = "SELECT * FROM images ORDER BY id DESC";
$result = mysqli_query($connect, $query);
$output = '
<table class="table table-bordered table-striped">
<tr>
<th width="10%">ID</th>
<th width="70%">Image</th>
<th width="10%">Change</th>
<th width="10%">Remove</th>
</tr>
';
while($row = mysqli_fetch_array($result))

$output .= '

<tr>
<td>'.$row["id"].'</td>
<td>
<img src="data:image/jpeg;base64,'.base64_encode($row['name'] ).'" height="60" width="75" class="img-thumbnail" />
</td>
<td><button type="button" name="update" class="btn btn-warning bt-xs update" id="'.$row["id"].'">Change</button></td>
<td><button type="button" name="delete" class="btn btn-danger bt-xs delete" id="'.$row["id"].'">Remove</button></td>
</tr>
';

$output .= '</table>';
echo $output;


if($_POST["action"] == "insert")

$file = addslashes(file_get_contents($_FILES["image"]["tmp_name"]));
$query = "INSERT INTO images(name) VALUES ('$file')";
if(mysqli_query($connect, $query))

echo 'Image Inserted into Database';


if($_POST["action"] == "update")

$file = addslashes(file_get_contents($_FILES["image"]["tmp_name"]));
$query = "UPDATE images SET name = '$file' WHERE id = '".$_POST["image_id"]."'";
if(mysqli_query($connect, $query))

echo 'Image Updated into Database';


if($_POST["action"] == "delete")

$query = "DELETE FROM images WHERE id = '".$_POST["image_id"]."'";
if(mysqli_query($connect, $query))

echo 'Image Deleted from Database';



?>









share|improve this question







New contributor




marcus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • "But I am stuck on trying to display" - where exactly? What is the problem?
    – Jeff
    17 hours ago










  • I am trying to display the images seen in the picture i attached on a separate page
    – marcus
    17 hours ago










  • Display where? What's your attempted code of the display page?
    – Edwin Krause
    17 hours ago










  • On a separate page, and I have tried to use my function i created but it didn't work so i deleted it. here is part of my index.php code i want the pictures to be displayed at.
    – marcus
    17 hours ago










  • <img class="block" id="u252_img" src="images/drake_photo_by_prince_williams_wireimage_getty_479503454.jpg?crc=3816007144" alt="" data-heightwidthratio="1" data-image-width="260" data-image-height="260"/>
    – marcus
    17 hours ago












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I have setup an Image database which can add/update/delete images from the database, But I am stuck on trying to display these images on a separate page. Any help would be greatly appreciated



Picture of page where i can add/update/delete images



This is my html code which lets me add/update/delete photos



<?php
if (isset($_POST['edit']))
require 'header.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Image Uploader</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<br /><br />
<div class="container" style="width:900px;">
<h3 align="center">Image Uploader</h3>
<br />
<div align="right">
<button type="button" name="add" id="add" class="btn btn-success">Add</button>
</div>
<br />
<div id="image_data">

</div>
</div>
</body>
</html>

<div id="imageModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Add Image</h4>
</div>
<div class="modal-body">
<form id="image_form" method="post" enctype="multipart/form-data">
<p><label>Select Image</label>
<input type="file" name="image" id="image" /></p><br />
<input type="hidden" name="action" id="action" value="insert" />
<input type="hidden" name="image_id" id="image_id" />
<input type="submit" name="insert" id="insert" value="Insert" class="btn btn-info" />

</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

<script>
$(document).ready(function()

fetch_data();

function fetch_data()

var action = "fetch";
$.ajax(
url:"action.php",
method:"POST",
data:action:action,
success:function(data)

$('#image_data').html(data);

)

$('#add').click(function()
$('#imageModal').modal('show');
$('#image_form')[0].reset();
$('.modal-title').text("Add Image");
$('#image_id').val('');
$('#action').val('insert');
$('#insert').val("Insert");
);
$('#image_form').submit(function(event)
event.preventDefault();
var image_name = $('#image').val();
if(image_name == '')

alert("Please Select Image");
return false;

else

var extension = $('#image').val().split('.').pop().toLowerCase();
if(jQuery.inArray(extension, ['gif','png','jpg','jpeg']) == -1)

alert("Invalid Image File");
$('#image').val('');
return false;

else

$.ajax(
url:"action.php",
method:"POST",
data:new FormData(this),
contentType:false,
processData:false,
success:function(data)

alert(data);
fetch_data();
$('#image_form')[0].reset();
$('#imageModal').modal('hide');

);


);
$(document).on('click', '.update', function()
$('#image_id').val($(this).attr("id"));
$('#action').val("update");
$('.modal-title').text("Update Image");
$('#insert').val("Update");
$('#imageModal').modal("show");
);
$(document).on('click', '.delete', function()
var image_id = $(this).attr("id");
var action = "delete";
if(confirm("Are you sure you want to remove this image from database?"))

$.ajax(
url:"action.php",
method:"POST",
data:image_id:image_id, action:action,
success:function(data)

alert(data);
fetch_data();

)

else

return false;

);
);
</script>

<?php

else
header("Location: index.php");
exit();



?>


This is the php code



<?php
//action.php
if(isset($_POST["action"]))

$connect = mysqli_connect("localhost", "Marcus", "1234", "loginsystem");
if($_POST["action"] == "fetch")

$query = "SELECT * FROM images ORDER BY id DESC";
$result = mysqli_query($connect, $query);
$output = '
<table class="table table-bordered table-striped">
<tr>
<th width="10%">ID</th>
<th width="70%">Image</th>
<th width="10%">Change</th>
<th width="10%">Remove</th>
</tr>
';
while($row = mysqli_fetch_array($result))

$output .= '

<tr>
<td>'.$row["id"].'</td>
<td>
<img src="data:image/jpeg;base64,'.base64_encode($row['name'] ).'" height="60" width="75" class="img-thumbnail" />
</td>
<td><button type="button" name="update" class="btn btn-warning bt-xs update" id="'.$row["id"].'">Change</button></td>
<td><button type="button" name="delete" class="btn btn-danger bt-xs delete" id="'.$row["id"].'">Remove</button></td>
</tr>
';

$output .= '</table>';
echo $output;


if($_POST["action"] == "insert")

$file = addslashes(file_get_contents($_FILES["image"]["tmp_name"]));
$query = "INSERT INTO images(name) VALUES ('$file')";
if(mysqli_query($connect, $query))

echo 'Image Inserted into Database';


if($_POST["action"] == "update")

$file = addslashes(file_get_contents($_FILES["image"]["tmp_name"]));
$query = "UPDATE images SET name = '$file' WHERE id = '".$_POST["image_id"]."'";
if(mysqli_query($connect, $query))

echo 'Image Updated into Database';


if($_POST["action"] == "delete")

$query = "DELETE FROM images WHERE id = '".$_POST["image_id"]."'";
if(mysqli_query($connect, $query))

echo 'Image Deleted from Database';



?>









share|improve this question







New contributor




marcus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have setup an Image database which can add/update/delete images from the database, But I am stuck on trying to display these images on a separate page. Any help would be greatly appreciated



Picture of page where i can add/update/delete images



This is my html code which lets me add/update/delete photos



<?php
if (isset($_POST['edit']))
require 'header.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Image Uploader</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<br /><br />
<div class="container" style="width:900px;">
<h3 align="center">Image Uploader</h3>
<br />
<div align="right">
<button type="button" name="add" id="add" class="btn btn-success">Add</button>
</div>
<br />
<div id="image_data">

</div>
</div>
</body>
</html>

<div id="imageModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Add Image</h4>
</div>
<div class="modal-body">
<form id="image_form" method="post" enctype="multipart/form-data">
<p><label>Select Image</label>
<input type="file" name="image" id="image" /></p><br />
<input type="hidden" name="action" id="action" value="insert" />
<input type="hidden" name="image_id" id="image_id" />
<input type="submit" name="insert" id="insert" value="Insert" class="btn btn-info" />

</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

<script>
$(document).ready(function()

fetch_data();

function fetch_data()

var action = "fetch";
$.ajax(
url:"action.php",
method:"POST",
data:action:action,
success:function(data)

$('#image_data').html(data);

)

$('#add').click(function()
$('#imageModal').modal('show');
$('#image_form')[0].reset();
$('.modal-title').text("Add Image");
$('#image_id').val('');
$('#action').val('insert');
$('#insert').val("Insert");
);
$('#image_form').submit(function(event)
event.preventDefault();
var image_name = $('#image').val();
if(image_name == '')

alert("Please Select Image");
return false;

else

var extension = $('#image').val().split('.').pop().toLowerCase();
if(jQuery.inArray(extension, ['gif','png','jpg','jpeg']) == -1)

alert("Invalid Image File");
$('#image').val('');
return false;

else

$.ajax(
url:"action.php",
method:"POST",
data:new FormData(this),
contentType:false,
processData:false,
success:function(data)

alert(data);
fetch_data();
$('#image_form')[0].reset();
$('#imageModal').modal('hide');

);


);
$(document).on('click', '.update', function()
$('#image_id').val($(this).attr("id"));
$('#action').val("update");
$('.modal-title').text("Update Image");
$('#insert').val("Update");
$('#imageModal').modal("show");
);
$(document).on('click', '.delete', function()
var image_id = $(this).attr("id");
var action = "delete";
if(confirm("Are you sure you want to remove this image from database?"))

$.ajax(
url:"action.php",
method:"POST",
data:image_id:image_id, action:action,
success:function(data)

alert(data);
fetch_data();

)

else

return false;

);
);
</script>

<?php

else
header("Location: index.php");
exit();



?>


This is the php code



<?php
//action.php
if(isset($_POST["action"]))

$connect = mysqli_connect("localhost", "Marcus", "1234", "loginsystem");
if($_POST["action"] == "fetch")

$query = "SELECT * FROM images ORDER BY id DESC";
$result = mysqli_query($connect, $query);
$output = '
<table class="table table-bordered table-striped">
<tr>
<th width="10%">ID</th>
<th width="70%">Image</th>
<th width="10%">Change</th>
<th width="10%">Remove</th>
</tr>
';
while($row = mysqli_fetch_array($result))

$output .= '

<tr>
<td>'.$row["id"].'</td>
<td>
<img src="data:image/jpeg;base64,'.base64_encode($row['name'] ).'" height="60" width="75" class="img-thumbnail" />
</td>
<td><button type="button" name="update" class="btn btn-warning bt-xs update" id="'.$row["id"].'">Change</button></td>
<td><button type="button" name="delete" class="btn btn-danger bt-xs delete" id="'.$row["id"].'">Remove</button></td>
</tr>
';

$output .= '</table>';
echo $output;


if($_POST["action"] == "insert")

$file = addslashes(file_get_contents($_FILES["image"]["tmp_name"]));
$query = "INSERT INTO images(name) VALUES ('$file')";
if(mysqli_query($connect, $query))

echo 'Image Inserted into Database';


if($_POST["action"] == "update")

$file = addslashes(file_get_contents($_FILES["image"]["tmp_name"]));
$query = "UPDATE images SET name = '$file' WHERE id = '".$_POST["image_id"]."'";
if(mysqli_query($connect, $query))

echo 'Image Updated into Database';


if($_POST["action"] == "delete")

$query = "DELETE FROM images WHERE id = '".$_POST["image_id"]."'";
if(mysqli_query($connect, $query))

echo 'Image Deleted from Database';



?>






php database






share|improve this question







New contributor




marcus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




marcus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




marcus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 17 hours ago









marcus

1




1




New contributor




marcus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





marcus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






marcus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • "But I am stuck on trying to display" - where exactly? What is the problem?
    – Jeff
    17 hours ago










  • I am trying to display the images seen in the picture i attached on a separate page
    – marcus
    17 hours ago










  • Display where? What's your attempted code of the display page?
    – Edwin Krause
    17 hours ago










  • On a separate page, and I have tried to use my function i created but it didn't work so i deleted it. here is part of my index.php code i want the pictures to be displayed at.
    – marcus
    17 hours ago










  • <img class="block" id="u252_img" src="images/drake_photo_by_prince_williams_wireimage_getty_479503454.jpg?crc=3816007144" alt="" data-heightwidthratio="1" data-image-width="260" data-image-height="260"/>
    – marcus
    17 hours ago
















  • "But I am stuck on trying to display" - where exactly? What is the problem?
    – Jeff
    17 hours ago










  • I am trying to display the images seen in the picture i attached on a separate page
    – marcus
    17 hours ago










  • Display where? What's your attempted code of the display page?
    – Edwin Krause
    17 hours ago










  • On a separate page, and I have tried to use my function i created but it didn't work so i deleted it. here is part of my index.php code i want the pictures to be displayed at.
    – marcus
    17 hours ago










  • <img class="block" id="u252_img" src="images/drake_photo_by_prince_williams_wireimage_getty_479503454.jpg?crc=3816007144" alt="" data-heightwidthratio="1" data-image-width="260" data-image-height="260"/>
    – marcus
    17 hours ago















"But I am stuck on trying to display" - where exactly? What is the problem?
– Jeff
17 hours ago




"But I am stuck on trying to display" - where exactly? What is the problem?
– Jeff
17 hours ago












I am trying to display the images seen in the picture i attached on a separate page
– marcus
17 hours ago




I am trying to display the images seen in the picture i attached on a separate page
– marcus
17 hours ago












Display where? What's your attempted code of the display page?
– Edwin Krause
17 hours ago




Display where? What's your attempted code of the display page?
– Edwin Krause
17 hours ago












On a separate page, and I have tried to use my function i created but it didn't work so i deleted it. here is part of my index.php code i want the pictures to be displayed at.
– marcus
17 hours ago




On a separate page, and I have tried to use my function i created but it didn't work so i deleted it. here is part of my index.php code i want the pictures to be displayed at.
– marcus
17 hours ago












<img class="block" id="u252_img" src="images/drake_photo_by_prince_williams_wireimage_getty_479503454.jpg?crc=3816007144" alt="" data-heightwidthratio="1" data-image-width="260" data-image-height="260"/>
– marcus
17 hours ago




<img class="block" id="u252_img" src="images/drake_photo_by_prince_williams_wireimage_getty_479503454.jpg?crc=3816007144" alt="" data-heightwidthratio="1" data-image-width="260" data-image-height="260"/>
– marcus
17 hours ago

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






marcus is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237177%2fphp-database-how-to-display-image-on-a-different-html-page%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes








marcus is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















marcus is a new contributor. Be nice, and check out our Code of Conduct.












marcus is a new contributor. Be nice, and check out our Code of Conduct.











marcus is a new contributor. Be nice, and check out our Code of Conduct.













 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237177%2fphp-database-how-to-display-image-on-a-different-html-page%23new-answer', 'question_page');

);

Post as a guest














































































這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

Museum of Modern and Contemporary Art of Trento and Rovereto