Skip to main content

How to Create Profile Information Page in PHP/MySQL


Good day everyone, I am going to create my new tutorial called "Simple Profile Information Page". In this tutorial you can integrate my previous code on How to Create Registration Page in PHP/MySQL and on How to Create Login Page in PHP/MySQL.

To start with, follow the steps below.

Create a Registration Page

First, follow the instruction on How to Create Registration Page in PHP/MySQL.

Create a Login Page

Next, create login page by the following the tutorial on How to Create Login Page in PHP/MySQL.

Creating a Profile Page

After following the procedure above, create a file and save it as home.php. This code will display the profile of the member after registration. To create a form, open your favorite HTML code editor and paste the code below after the body tag.
Your Profile Information
no image found
FirstName:
LastName:
Gender:
Address:
Contact No.:

That’s it! You’ve been successfully created your simple profile page with registration and login, see you in my next tutorial.

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Submitted byAnonymous (not verified)on Sat, 12/01/2012 - 11:04

why take so long for the login to login user in

Submitted byAnonymous (not verified)on Sat, 01/19/2013 - 17:46

Hai i want new tutorial script php mysql

Submitted byAnonymous (not verified)on Fri, 01/25/2013 - 17:34

add this on top of home.php:
<?php require_once('auth.php');?>

Submitted byAnonymous (not verified)on Mon, 02/25/2013 - 19:52

Thnku sooo much for this code.....after getting this code. i solved my problem after 10 days.. soo again thnks

Submitted byAnonymous (not verified)on Fri, 07/12/2013 - 15:43

am getting the following error message

Undefined variable: _SESSION in C:\wamp\www\Registration\home.php on line 3

Undefined variable: picture in C:\wamp\www\Registration\home.php on line 21

SCREAM: Error suppression ignored for
( ! ) Notice: Undefined variable: fname in
C:\wamp\www\Registration\home.php on line 23

( ! ) SCREAM: Error suppression ignored for
( ! ) Notice: Undefined variable: lname in C:\wamp\www\Registration\home.php on line 27

can anyone help please

PLEASE HELP! I'M GETTING THIS ERROR

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\pear\Auth.php on line 469

Notice: Undefined variable: _SESSION in C:\xampp\htdocs\wew\registration\home.php on line 4

Submitted byTitouan (not verified)on Mon, 09/23/2013 - 03:12

Working fine ! But I'm working on a web app and I'm looking for a way for a user to log Out and, I'm looking too for a way to redirect peoples arriving on index.php without logged in at login.php is there a way ?
Thanks

Submitted bymichii (not verified)on Mon, 10/14/2013 - 01:30

Am getting the followings erros
Notice: Undefined variable: _SESSION in C:\wamp\www\my_school_management system\home.php on line 54
pls i need your help....

Submitted byvinit (not verified)on Fri, 11/01/2013 - 01:38

plzzz suggest me about picture upload in registration form, and showing in home page or profile page.

Submitted bySandeep Gupta (not verified)on Sat, 12/14/2013 - 19:13

am getting the following error message

Undefined variable: _SESSION in C:\wamp\www\Registration\home.php on line 3

Undefined variable: picture in C:\wamp\www\Registration\home.php on line 21

SCREAM: Error suppression ignored for
( ! ) Notice: Undefined variable: fname in
C:\wamp\www\Registration\home.php on line 23

( ! ) SCREAM: Error suppression ignored for
( ! ) Notice: Undefined variable: lname in C:\wamp\www\Registration\home.php on line 27

can anyone help please

hello ur problem soloution is

require_once('auth.php');
require_once('connection.php');
$id=$_SESSION['SESS_MEMBER_ID'];
$result3 = mysql_query("SELECT * FROM member where mem_id='$id'");
while($row3 = mysql_fetch_array($result3))
{
$fname=$row3['fname'];
$lname=$row3['lname'];
$address=$row3['address'];
$contact=$row3['contact'];
$picture=$row3['picture'];
$gender=$row3['gender'];
}
?>

Notice: Undefined variable: _SESSION in C:\xampp\htdocs\home.php on line 5
Your Profile Information
logout
no image found
FirstName:

Notice: Undefined variable: fname in C:\xampp\htdocs\home.php on line 25
LastName:

Notice: Undefined variable: lname in C:\xampp\htdocs\home.php on line 29
Gender:

Notice: Undefined variable: gender in C:\xampp\htdocs\home.php on line 33
Address:

Notice: Undefined variable: address in C:\xampp\htdocs\home.php on line 37
Contact No.:

Notice: Undefined variable: contact in C:\xampp\htdocs\home.php on line 41

Submitted byManassa Programmer (not verified)on Sun, 06/08/2014 - 00:23

  1. <?php
  2. $local_host = 'localhost'; //host doman.com
  3. $db_host = $local_host;
  4.  
  5. $db_user = 'root'; // database username
  6. $user = $db_user;
  7.  
  8. $db_pass = ''; //db password
  9. $pass = $db_pass;
  10.  
  11. $db_name = 'member'; //
  12. $db = $db_name;
  13.  
  14. // connect to mysql
  15. $sql_con = mysql_connect("$db_host","$db_user","");
  16. $sql_db = mysql_select_db("$db") ;
  17.  
  18. $sql = "SELECT * FROM user";
  19. $query = mysql_query($sql);
  20.  
  21. while($row = mysql_fetch_array($query)){
  22.  
  23. $username = $row['username'];
  24. $time = $row ['time'];
  25.  
  26.  
  27. //make a user link when you click in any user this link well open his profile
  28. echo '<div style="font-size:18px; color:blue; margin-top:-5px;" ><a href="profile.php?'.$_COOKIE['user'].'">'.$username.'</a></div>';
  29.  
  30. //$n = $_REQUEST[$time];
  31. //setcookie('user','manassa');
  32. }
  33.  
  34.  
  35. ?>

after that make new file as profile.php

profile.php

  1. <?php
  2.  
  3.  
  4. if($_REQUEST['user'] == $_COOKIE['user'] || $_COOKIE['user'] == 'Admin'){
  5.  
  6. echo'<form action="settings.php">
  7. <input id="button" type="submit" value="Settings V"/>
  8. <input id="button" type="submit" value="massege"/>
  9. </form>';
  10. }
  11. elseif($_REQUEST['user'] == 'user'){
  12. //header("location:profile.php");
  13. }
  14. else
  15. {
  16. echo'<form action="follow.php">
  17. <input id="button" type="submit" value="follow +"/>
  18. <input id="button" type="submit" value="massege"/>
  19. </form>';
  20. }
  21. }
  22.  
  23. ?>
  24.  
  25. </div>
  26. </div>
  27.  
  28.  
  29.  
  30.  
  31.  
  32. <?php
  33.  
  34.  
  35. //$man = $_GET[$username]
  36. if(isset($_REQUEST['user'])){
  37. echo $_REQUEST['user']."Profile"; //code here
  38.  
  39. // class information ()/{ // this function To Get profile Information!
  40. $user = $_REQUEST['user'];
  41. $sql = "SELECT * FROM user WHERE username='$user'" ;
  42. $query = mysql_query($sql);
  43. while($rows = mysql_fetch_array($query))
  44. {
  45.  
  46. $username = $rows ['username'];
  47. /* $Email = $rows ['Email'];
  48.   $pass = $rows ['time'];
  49.   $quetion = $rows ['quetions'];
  50.   $answer = $rows ['answer']; */
  51.  
  52.  
  53.  
  54. /*echo "<br/>".$username;
  55.   echo "<br/>".$Email;
  56.   echo "<br/>".$pass;
  57.   echo "<br/>".$quetion;
  58.   echo "<br/>".$answer;
  59.   */
  60.  
  61.  
  62.  
  63.  
  64.  
  65. }
  66.  
  67. }
  68.  
  69.  
  70. else
  71. {
  72. header("location:profile.php?user=".$_COOKIE['user']);
  73. }
  74.  
  75.  
  76.  
  77.  
  78. ?>
Submitted byjosephbupe (not verified)on Sat, 07/12/2014 - 16:08

Could you kindly update your scripto mysqli?

Submitted bythnkz but prof… (not verified)on Thu, 07/24/2014 - 17:51

thanks tht helped a lot.. but cud you please tell me how to get an image displayed there. please make it more clear...thnkz in advance

Submitted byChristopher Barnett (not verified)on Thu, 02/26/2015 - 20:13

Hi is it possible to make these fields editable
example user during signup entered wrong telephone number and wants to change it.

Submitted byRamesh Gupta (not verified)on Fri, 04/24/2015 - 13:26

hi i am getting error in my code
Warning: mysql_error(): supplied resource is not a valid MySQL-Link resource in C:\wamp\www\gurumaya\user\newuser\profile.php on line 138 and 139
my code is:

133: include('reg_config.php');
134: $id=$_SESSION['SESS_MEMBER_ID'];
135: // Get page data
136: $query = 'SELECT * FROM userlog where `id`=1;';
137: //$query= mysql_query("SELECT * FROM `userlog` WHERE id = '".$_SESSION['SESS_MEMBER_ID']."' ");

138: $result=mysql_query($query);
139: $num=mysql_num_rows($result);
140: $i=0;
141: while ($i

$id=mysql_result($result,$i,"id");
$fname=mysql_result($result,$i,"fname");
$lname=mysql_result($result,$i,"lname");
$mobile=mysql_result($result,$i,"mobile");
$email=mysql_result($result,$i,"email");
$address= mysql_result($result,$i,"address");
$i++;
}

Please this code is not fetching data in my profile.php.
Can any one help?

require_once('connection.php');
$id=$_SESSION['SESS_MEMBER_ID'];
$result3 = mysql_query("SELECT * FROM member where mem_id='$id'");
while($row3 = mysql_fetch_array($result3))
{
$fname=$row3['fname'];
$lname=$row3['lname'];
$address=$row3['address'];
$contact=$row3['contact'];
$picture=$row3['picture'];
$gender=$row3['gender'];
}
?>

Your Profile Information
no image found
FirstName:
LastName:
Gender:
Address:
Contact No.:

Submitted bywarteeeesa (not verified)on Thu, 03/14/2019 - 16:24

I found this site and hmm i cant use shoutbox. It is possible?

Submitted byterwixonse (not verified)on Sat, 05/18/2019 - 13:12

I am from Slovenia. I can help with build this forum. Thanks for approved.

Jaz sem Slovenka. Lahko pomagam pri razvoju foruma.

Submitted byslovaaride (not verified)on Sun, 08/04/2019 - 07:30

It is english language possible to write? Sorry for my proor eng

Submitted bycheckvilCal (not verified)on Fri, 08/23/2019 - 13:42

i am Checkvil. This i my login on this forum. it is good ? :)

Submitted bycheckvilCal (not verified)on Fri, 08/30/2019 - 07:37

i am Checkvil. This i my login on this forum. it is good ? :)

Submitted bycheckvilCal (not verified)on Wed, 09/04/2019 - 10:22

i am Checkvil. This i my login on this forum. it is good ? :)

Submitted bycheckvilCal (not verified)on Mon, 09/09/2019 - 23:07

i am Checkvil. This i my login on this forum. it is good ? :)

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.