We help IT Professionals succeed at work.

New podcast episode! Our very own Community Manager, Rob Jurd, gives his insight on the value of an online community. Listen Now!

x

Displaying Profile picture

Snigdha Mishra
on
85 Views
Last Modified: 2017-04-29
<?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();
?>

Open in new window




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");
?>

Open in new window

Please help me out Please
Comment
Watch Question

Most Valuable Expert 2011
Author of the Year 2014
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019

Commented:
@Snigdha Mishra, I see you have recently joined, welcome to EE.

I have added code tags to your post. Code tags help to make code more readable and easier to refer to. You can add code tags by highlighting your code and clicking the CODE button in the toolbar.

JulianH
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019

Commented:
@Ray,

My answer was not an answer - recommend full points goes to your comment here

https://www.experts-exchange.com/questions/29014962/Displaying-Profile-picture.html#a42085092
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.