1. CSS
  2. Flash
  3. HTML
  4. Illustrator
  5. Java
  6. JavaScript
  7. Maya
  8. Photography
  9. Photoshop
  10. PHP
  11. Ruby
  12. Ruby on Rails
  13. 3ds Max

HTML: Upload an image and make an image gallery

  1. Clicks today:
    0
  2. Clicks this month:
    3
  3. Overall rating:
    5.00/5

HTML » Document Structure — over 5 years ago
Here is the overview what we are going to do. Hey friends today we will learn how to upload an image in php and display all images in a nice way. At first we will create a form and using form we will upload the image in server. Then we will save the image in a folder and store the image name in mysql.We will use mysqli as mysql is depreciated Then we will display all the images.

Comments

avatarPatrickLawrence 4 days ago

You can get all images with the below code.

<? php session_START (); // $ id = $ _GET ['id'];

 $ link = mysql_connect (&quot;localhost&quot;, &quot;root&quot;, &quot;#&quot;) or die (&quot;Couldn't connect&quot;);
 mysql_select_db (&quot;gallery&quot;) or die (&quot;Couldn't connect&quot;);

 $ sql = &quot;SELECT img FROM image&quot;;
 $ result = mysql_query (&quot;$ sql&quot;);
 if (mysql_num_rows ($ result)&gt; 0) {
     while ($ row = mysql_fetch_assoc ($ result)) {
         header (&quot;Content-type: image / jpeg&quot;);
         echo $ row ['img'];
     }
     mysql_close ($ link);
 } else {
     echo (&quot;No data&quot;);
 }

?> <a href="https://buyessays.onl/buy-research-papers-cheap/">buy research papers cheap</a>

avatarPatrickLawrence 4 days ago

You can get all images with the below code.

<? php session_START (); // $ id = $ _GET ['id'];

 $ link = mysql_connect (&quot;localhost&quot;, &quot;root&quot;, &quot;#&quot;) or die (&quot;Couldn't connect&quot;);
 mysql_select_db (&quot;gallery&quot;) or die (&quot;Couldn't connect&quot;);

 $ sql = &quot;SELECT img FROM image&quot;;
 $ result = mysql_query (&quot;$ sql&quot;);
 if (mysql_num_rows ($ result)&gt; 0) {
     while ($ row = mysql_fetch_assoc ($ result)) {
         header (&quot;Content-type: image / jpeg&quot;);
         echo $ row ['img'];
     }
     mysql_close ($ link);
 } else {
     echo (&quot;No data&quot;);
 }

?> <a href="https://buyessays.onl/buy-research-papers-cheap/">buy research papers cheap</a>

avatarPatrickLawrence 4 days ago

You can get all images with the below code.

<? php session_START (); // $ id = $ _GET ['id'];

 $ link = mysql_connect (&quot;localhost&quot;, &quot;root&quot;, &quot;#&quot;) or die (&quot;Couldn't connect&quot;);
 mysql_select_db (&quot;gallery&quot;) or die (&quot;Couldn't connect&quot;);

 $ sql = &quot;SELECT img FROM image&quot;;
 $ result = mysql_query (&quot;$ sql&quot;);
 if (mysql_num_rows ($ result)&gt; 0) {
     while ($ row = mysql_fetch_assoc ($ result)) {
         header (&quot;Content-type: image / jpeg&quot;);
         echo $ row ['img'];
     }
     mysql_close ($ link);
 } else {
     echo (&quot;No data&quot;);
 }

?>

[url=https://buyessays.onl/buy-research-papers-cheap/]buy research papers cheap[/url]

avatarPatrickLawrence 4 days ago

You can get all images with the below code.

<? php session_START (); // $ id = $ _GET ['id'];

 $ link = mysql_connect (&quot;localhost&quot;, &quot;root&quot;, &quot;#&quot;) or die (&quot;Couldn't connect&quot;);
 mysql_select_db (&quot;gallery&quot;) or die (&quot;Couldn't connect&quot;);

 $ sql = &quot;SELECT img FROM image&quot;;
 $ result = mysql_query (&quot;$ sql&quot;);
 if (mysql_num_rows ($ result)&gt; 0) {
     while ($ row = mysql_fetch_assoc ($ result)) {
         header (&quot;Content-type: image / jpeg&quot;);
         echo $ row ['img'];
     }
     mysql_close ($ link);
 } else {
     echo (&quot;No data&quot;);
 }

?>

[url="https://buyessays.onl/buy-research-papers-cheap/"]buy research papers cheap[/url]

avatarPatrickLawrence 4 days ago

https://en.wikipedia.org

avatarPatrickLawrence 4 days ago

http://en.wikipedia.org

avatarPatrickLawrence 4 days ago

(wiki)[https://en.wikipedia.org] [[https://en.wikipedia.org wiki]] [[https://en.wikipedia.org|wiki]] wiki [https://en.wikipedia.org wiki] wiki:https://en.wikipedia.org

Your Comment

You must be logged in to post a comment.