troubleshooting Question

Displaying Profile picture

Avatar of Snigdha Mishra
Snigdha Mishra asked on
PHP
3 Comments1 Solution139 ViewsLast Modified:
<?php
session_start();
error_reporting(0);
ob_start();
?>
               
  <?php
			 include('MasterConnection.php');
			 if(isset($_POST["submit"]))
			 {	 
					$user_photo = ""; 
					if($_FILES['profile_pic']['name']!="")
					{		
						$photo_name = $_FILES['profile_pic']['name'];
						$sorc =$_FILES['profile_pic']['tmp_name'];						
						$desti = "photoo/".$photo_name;
					   
						if(move_uploaded_file($sorc,$desti))
						{
							$user_photo = $photo_name;
							//echo($user_photo);
						}		
					}
			 
			 }
			 $sql="INSERT INTO CustomerRegistration(cname,age,bldgrp,gender, address,city,Country,pincode, Category, Purose , mobileNo , username ,password, image,status )
                 VALUES ('$_POST[cname]','$_POST[age]','$_POST[bg]','$_POST[gender]','$_POST[address]','$_POST[City]','$_POST[country]','$_POST[pc]','$_POST[Category]','$_POST[Purose]','$_POST[mobileNo]','$_POST[Mailid]','$_POST[Password]','$user_photo','$_POST[status]')";

                if (!mysql_query($sql,$con))
                {
                        die('Error in Storing : ' . mysql_error());
                }
             
                
                mysql_close($con);
                 echo '<script language="javascript">';
                echo 'alert("Successfully Registered"); location.href="CustomerLogin.php"';
                echo '</script>';
				 
			 
			 ?>
                <?php
					

                
              
?>
<?php
ob_end_flush();
?>



It is to upload profile pic now using this how can i code to diaplayprofile image of current session
and i want to display session in below page

<head>
<title>Patient Panel</title>
</head>
<?php
include("HeaderMaster1.php");
?>

	<!-- Content -->
	<div id="content" class="shell">
		 <table border="0" cellpadding="10">
              <br />
   <p style="color:#009; font-weight:bolder; font-family:'Courier New', Courier, monospace; font-size:40;">Welcome to Online Consultation</p>
              
              <br />
               <?php
             include('../MasterConnection.php');
		$result1 = mysql_query("SELECT * FROM customerregistration where username='$login_session'");
		
		while($row1 = mysql_fetch_array($result1))
		{
	      echo"<tr>";
             echo "<th><p>YOUR NAME</p></th><td><p>:&nbsp;&nbsp;". $row1['cname']."</p></td>";
		  echo"</tr>";
            echo"<tr>";
             echo "<th><p>ADDRESS</p></th><td><p>:&nbsp;&nbsp;". $row1['address']."</p></td>";
		  echo"</tr>";
		  echo"<tr>";
             echo "<th><p>AGE</p></th><td><p>:&nbsp;&nbsp;". $row1['age']."</p></td>";
		  echo"</tr>";
		  echo"<tr>";
             echo "<th><p>BLOOD GROUP</p></th><td><p>:&nbsp;&nbsp;". $row1['bldgrp']."</p></td>";
		  echo"</tr>";
		  echo"<tr>";
             echo "<th><p>COUNTRY</p></th><td><p>:&nbsp;&nbsp;". $row1['country']."</p></td>";
		  echo"</tr>";
		  echo"<tr>";
             echo "<th><p>CONTACT</p></th><td><p>:&nbsp;&nbsp;". $row1['mobileNo']."</p></td>";
		  echo"</tr>";
		  }
mysql_close($con);

?>

</table>
		
		
</div>
	
	<!-- End Content -->

<?php
include("FooterMaster1.php");
?>
Please help me out Please
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros