We are going to build two simple PHP pages, the first one will list all the images stored in the database in an HTML table. Clicking on any item on this list will take us to the second script that will output the image in the browser:
1. Open a new file in the text editor and add the following PHP/HTML code to it:
<?php require 'dbconnection.php'; $mongo = DBConnection::instantiate(); $gridFS = $mongo->database->getGridFS(); $objects = $gridFS->find(); ?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Uploaded Images</title> <link rel="stylesheet" type="text/css" href="styles.css"/> </head> <body> <div id="contentarea"> <div id="innercontentarea"> <h1>Uploaded Images</h1> <table class="table-list" cellspacing="0" cellpadding="0"> <thead> <tr> <th width="40%">Caption</th> <th width="30%">Filename</th>...