Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2009
    Posts
    40
    Thanks
    3
    Thanked 0 Times in 0 Posts

    jpg image not display on page

    I have problem in display jpg image on my page
    $path="images/image/";
    $pictures=basename($row['picture']);
    ?>
    <img src="<?php echo $path.$pictures;?>"/>
    Can any one help me what is the error

    complete page code
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
    <HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>IRCC | Main Page</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><LINK 
    href="include/stylesheet.css" type=text/css rel=stylesheet><LINK 
    href="include/style.css" type=text/css rel=stylesheet>
    <META content="MSHTML 6.00.2900.3492" name=GENERATOR>
    <meta name="verify-v1" content="RqoG6VTaZUek7CeoCQtbaup308n1ZGMddxexTNmKx0o=" />


    <style type="text/css">
    <!--
    .style31 {font-weight: bold}
    -->
    </style></HEAD>
    <BODY leftMargin=0 topMargin=0>
    <TABLE cellSpacing=0 cellPadding=0 border=0 align="center" width="800">
      <TBODY>
         <TR vAlign=top >
          <TD colSpan=2 background="images/index_01.gif" height="128" width="800" align="right" class="date"><table width="800" border="0" cellspacing="0" cellpadding="0" height="128">
            <tr>
              <td valign="top" style="padding-left:20px"><p>
                  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="73" height="73">
                  <param name="movie" value="include/logoflash.swf">
                  <param name="quality" value="high">
                  <embed src="include/logoflash.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="73" height="73"></embed>
                </object>
                </p>
             
                </td>
              <td valign="top">  <script type="text/javascript" language="JavaScript1.2" src="include\date.js"></script>&nbsp;</td>
            </tr>
          </table></TD>
              </TR>
        <TR vAlign=top>
          <TD colSpan=2><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
            <TBODY>
              <TR>
                <TD width="12%" background=images/bg_top.jpg><DIV align=center>
                    <P class=login2><SPAN class=style28><SPAN 
                class=style29><SPAN class=style30><strong><a href="index.htm">Home</a></strong></SPAN>       
                </DIV>
                    </DIV></TD>
                <TD width="1%"><IMG src="images/banar.gif"></TD>
                <TD width="14%" background=images/bg_top.jpg><DIV align=center>
                    <P class=login><SPAN class=style28><SPAN 
                class=style29><SPAN class=style30 style31><a href="about.htm">About</a></SPAN>       
                </DIV></TD>
                <TD width="1%"><IMG height=25 src="images/banar.gif" 
                      width=9></TD>
                <TD width="13%" background=images/bg_top.jpg><DIV align=center>
                    <P class=login><SPAN class=style28><SPAN 
                class=style29><SPAN class=style30><strong><a href="dept.htm">Departments</a></strong></SPAN>       
                </DIV></TD>
                <TD width="1%"><IMG height=25 src="images/banar.gif" 
                      width=9></TD>
                <TD width="13%" background=images/bg_top.jpg><DIV align=center>
                    <P class=login><SPAN class=style28><SPAN 
                class=style29><SPAN class=style30><strong><a href="consult.htm">Services</a></strong></SPAN>            </DIV></TD>
                <TD width="1%"><IMG height=25 src="images/banar.gif" 
                      width=9></TD>
                <TD width="13%" background=images/bg_top.jpg><DIV align=center>
                    <P class=login><SPAN class=style28><SPAN 
                class=style29><SPAN class=style30><strong><a href="journal.html">Publications</a></strong></SPAN>       
                </DIV></TD>
                <TD width="1%"><IMG height=25 src="images/banar.gif" 
                      width=9></TD>
                <TD width="13%" background=images/bg_top.jpg><DIV align=center>
                    <P class=login><strong><SPAN class=style28><SPAN 
                class=style29><SPAN class=style30><a href="map.htm">Site Map</a></SPAN> </strong>      
                </DIV></TD>
                <TD width="1%"><IMG height=25 src="images/banar.gif" 
                      width=9></TD>
                <TD width="14%" background=images/bg_top.jpg><DIV align=center>
                    <P class=login><strong><SPAN class=style28><SPAN 
                class=style29><SPAN class=style30><a href="contact.htm">Contact Us</a></SPAN> </strong>      
                </DIV>
                    </DIV></TD>
              </TR>
            </TBODY>
          </TABLE></TD>
        </TR>
        <TR>
        <TD vAlign="top" align="middle" width="150" 
                height="762" style=" background:url(images/bg_left2.jpg) ;background-repeat:repeat-x">
            <P>&nbsp;</P>
            <DIV style="PADDING-LEFT: 30px;">
            <P class="login1" align=left><STRONG><a
                href="about.htm" class="style31">About IRCC</a></STRONG></P>
            <P class="login" align=left>&nbsp;</P>
            <P align=left class="login1"><A 
                href="dept.htm"><strong>Departments</strong></A></P>
            <P class="login1" align=left>&nbsp;</P>
            <P class="login1" align=left><STRONG><A 
                href="inter.html">Interrelation</A></STRONG></P>
            <P class="login1" align=left>&nbsp;</P>
            <P class="login1" align=left><strong><a href="trade.htm">Trade Point</a></strong></P>
            <P align=left class="login1">&nbsp;</P>
            <P align=left class="login1"><a href="related.htm"><strong>Related Links </strong></a></P>
          </DIV></TD>
          <TD vAlign=top width=652><TABLE width="100%" border=0 cellpadding="0" cellspacing="0">
            <TBODY>
              <TR>
                <TD vAlign=top width="48%"><TABLE width="100%" 
                      border=1 borderColor=#ffffff bgcolor="#2B944E" height="800">
                  <TBODY>
                    <TR>
                      <TD vAlign=top bgColor=#ffffff ><table width="600" border="0" cellspacing="10" cellpadding="0">
                      <tr>
                        <td><div style="padding-right:30px">
                            <?php
    include("connect.php");


    $newsid=$_GET['newsid'];
    $result=mysql_query("select title,content,picture,adddate from news WHERE newsid='$newsid'");

        while (
    $row mysql_fetch_array($result)) {
        echo 
    "<table align = 'left'><tr><td>";
        echo 
    "<b>".$row['title'].":</b>";
        echo 
    "</td></tr>";
        echo 
    "<tr><td>";
        echo 
    $row['content'];
        echo 
    "</td></tr>";
        echo 
    "<tr><td>";
        
    $path="images/image/";
        
    $pictures=basename($row['picture']);
         
    ?>
                            <img src="<?php echo $path.$pictures;?>"/>
                            <?php
        
    echo "</td></tr>";
        echo 
    "<tr><td>";
         
    ?>
                            <?php
        
    echo "</td></tr>";echo "<tr><td>";
        echo 
    $row['adddate'];
        echo 
    "</td></tr>";
        echo 
    "</table>";
        } 
          
     
    ?>
                        </div></td>
                      </tr>
                      <tr>
                        <td><div>
                            <table>
                              <form action="send.php" method="post" name="form1" id="form1">
                                <tr>
                                  <td><input type="submit" name="send" value="send" />
                                      <input type="hidden" name="newsid" value="<?php echo $newsid;?>" />
                                  </td>
                                  <td><input type="button" name="print" value="print" onClick="window.print()" />
                                  </td>
                                </tr>
                              </form>
                            </table>
                        </div></td>
                      </tr>
                    </table>&nbsp;
                   </TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
               
              </TR>
            </TBODY>
          </TABLE></TD>
        </TR>
        <TR>
          <TD>&nbsp;</TD>
          <TD align=middle bgColor=#ffffff><SPAN class=chat_message_admin><strong>All copyright reserved &copy;IRCC IT section 2009 </strong></SPAN></TD>
        </TR>
      </TBODY>
    </TABLE>
    </BODY></HTML>

  • #2
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    $path="images/image/";
    $pictures=basename($row['picture']);
    ?>
    <img src="<?php echo $path.$pictures;?>"/>


    works fine, your problem is in the filename, path or sql

  • #3
    New Coder
    Join Date
    Sep 2009
    Posts
    40
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I have checked the file name,path & sql all are correct
    I right click on the picture press proprties give me the link to picture(That's mean there is no problem on path,name & sql)
    This link of the page containing picture
    http://www.ircc.gov.sd/detial.php?newsid=87
    please help me


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •