Dear respected senior php web developer i m new to php webdeveloping and hoping for a good coder one day inshaALLAH
SIR i have problem with my image hosting script is for uploading images
and is for displaying all uploaded images how ever i want to show there small thumbs i put everything correct in <img scr=""> tag but still my images thumbs not loading pelase help me thanks!
i m giving my exact code for showing images thumbs here is the code.

        <title>PHP Photo Hosting Script</title>
        <link rel="stylesheet" type="text/css" href="main.css" />

include "conn.php";
echo "<center>";
include "head_menu.php";
echo "</center><br>";

<div class="images_boundry">
<?php $result = mysql_query("SELECT * FROM imgs_name ");
while($images = mysql_fetch_array($result))
    $show_img = $images['img_name'];
    echo "<div class='images_thumb'><a href='".$show_img."'><img scr='tahir_upload/".$show_img."'></img></a></div>";

<div style="clear:both"></div>

Recommended Answers

All 4 Replies

Change line 20 to this:

echo "<div class='images_thumb'><a href='".$show_img."'><img src='/tahir_upload/".$show_img."'></img></a></div>";

Note the / in front of your image source, and it should be src (not scr).

Also, you should not be using an </img> closing tag - there is no such thing. It should be:

echo "<div class='images_thumb'><a href='".$show_img."'><img src='/tahir_upload/".$show_img."' /></a></div>";
Member Avatar for diafol

Urgh. Tidy up your deprecated and dodgy HTML before you start messing with php.


No need for this - use CSS

<div style="clear:both"></div>

Although not wrong, should be dealt with in CSS. However, why is it empty? Markup like this should be avoided where possible.

Simply has already noted the mistake with the <img /> tag.

Also you have no doctype declared, e.g. for HTML5:

<!DOCTYPE html>

A missing DTD may trigger quirksmode in some browsers.

Thanks every body for your good replies i like that fast resolution for my problem. i took very big mistakes in little tags i learned a lot and get that if i don't think about small things i can't be grow up in programming field. once more time thanks for all supporters see you next time with new issues inshALLAH

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.