Dynamically create content from SQL database

barsumerhai

New Member
So basically all I want to do is a basic image uploading page. When the user fills out a form they submit a file either from their computer or from a URL then the image gets stored on the server.I want to then display the images on a HTML page. I already have the code to dynamically create the \[code\]div\[/code\]s that would hold the uploaded content.\[code\]function AddTiles() { var mydiv = document.createElement("div"); mydiv.setAttribute("id", "mydiv"); mydiv.setAttribute("class", "tiles"); mainContent.appendChild(mydiv);}\[/code\]But whenever you upload the image the page refreshes, and then the divs would no longer be there to place the image in. So I want to save the image to a database instead, and then on page load, read through the database and generate the html content and then display the images. So if there were 4 images in your database, then the program would create 4 div tags and put each image in its respective div tag. Also, I just need the code to read from the database and create the html content on load. I can create the database and store the images with no problem.
 
Back
Top