Jump to content

Image Not Shown


m@m

Recommended Posts

Here is the User profile search form... when i search that all details comes without Employee's Photo.. What's the error ?

 

</head>
<body>

<?php 

		$uname = $_POST['uname'];
		$sql = "SELECT * FROM emp WHERE uname = '$uname'";
		$result = mysql_query($sql);
		if (mysql_num_rows($result) > 0)
		{
			while ($row = mysql_fetch_array($result))
			{
				$fname = $row['fname'];
                    $lname = $row['lname'];
				$email = $row['email'];
				$address = $row['address_1'];
				$address2= $row['address_2'];
				$address3= $row['address_3'];
				$image = $row['image'];
                    $gender=$row['gender'];
                    $mobile=$row['tp_mobile'];
                    $land=$row['tp_lnd'];
                    $bod=$row['bod'];
                    
			}
            }
                  
	?>  


<div class="main">
  <div class="header">
    <div class="header_resize">
      <div class="logo"><h1></h1></div>
      
      
      <div class="clr"></div>
      <div class="search">
        <form id="form1" name="form1" method="post" action="emp_profile.php">
          <span>
          <input name="uname" type="text" class="keywords" id="textfield" maxlength="50"  />
          
          </span>
          <input name="image" type="image" src="images/search.gif" class="button" />
        </form>
      </div>
               <div class="menu">
        <ul>
          <!--
<li><a href="index.html" class="active">Home</a></li>
          <li><a href="services.html">Services</a></li>
          <li><a href="about.html"> About Us </a></li>
          <li><a href="contact.html"> Contact Us</a></li>
-->
        </ul>
      </div>
      
    </div>
    <div class="clr"></div>
  </div>
        <div class="clr"></div>
  
    <div class="body">
        <div class="body_resize">

        <form id="" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data"  accept-charset='UTF-8'> 
        <div id="container">

<fieldset >

<div id="content-container1">
	<div id="content-container2">
         
		<div id="section-navigation">
			<img align="top"  width="175" height="200" src="emp_images/<?php echo $image; ?>"/>
                <div>
                  
                
                    <!--
<label>Patient Name : </label>

-->
<br />


     
     </div>
                

		</div>

		<div id="content" align="justify">
           

                
			<h2>
		    <label for="fname"> <?php echo $fname; ?></label> 
                <label for="lname"> <?php echo $lname; ?></label>
			</h2>
			<p>
                <label><b>Email:</b></label>
                <br />
                <label for="email"> <?php echo $email; ?></label>
			</p>
			<p>
                <label><b>Employee Address:</b></label>
                <br />
                <label > <?php echo $address; ?></label> </p> 
                <p>
                <label><b>Employee Address 2:</b></label>
                <br />
                <label > <?php echo $address2; ?></label>
                
                <p>
                <label><b>Employee Address 3:</b></label>
                <br />
                <label > <?php echo $address3; ?></label>


                    <p>
                    <label><b>Gender:</b></label>
                    <br />
                <label > <?php echo $gender ?></label>
                </p> 



                    <p>
                    <label><b>Employees Mobile:</b></label>
                    <br />
                    <label > <?php echo $mobile ?></label>
                    </p>

                    <p>
                    <label><b>Employees Resident Number:</b></label>
                    <br />
                    <label > <?php echo $land ?></label>
                        </p>


				<p>
                    <label><b>Date of Birth:</b></label>
                    <br />
                    <label > <?php echo $bod ?></label>
                        </p>
        	


                

</div>
            
</div>
  </fieldset>    
     
      <div class="clr"></div>
      
      
    </div>
  </div>
  </form>

                <div class="footer">
                <div class="footer_resize">
                <p>© P2011-001</p>
                </div>
                <div class="clr"></div>
                </div>
       
    </div>
    
</div>
</div>
</body>
</html>


<?php 
mysql_close($con);
?>

Link to comment
https://forums.phpfreaks.com/topic/250390-image-not-shown/
Share on other sites

Well, I would think that the src attribute of the image is not pointing to a valid image. Have you checked the rendered the HTML source and verified the value of the image attribute? Is it valid?

 

EDIT: FYI you are providing a 'relative' path to the image. You may be running this from a URL that is not correct for that relative path.

Link to comment
https://forums.phpfreaks.com/topic/250390-image-not-shown/#findComment-1284723
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.