How to Create Profile Information Page in PHP/MySQL
Submitted by argie on Saturday, May 26, 2012 - 11:24.
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.- <?php
- require_once('connection.php');
- $id=$_SESSION['SESS_MEMBER_ID'];
- {
- $fname=$row3['fname'];
- $lname=$row3['lname'];
- $address=$row3['address'];
- $contact=$row3['contact'];
- $picture=$row3['picture'];
- $gender=$row3['gender'];
- }
- ?>
- <table width="398" border="0" align="center" cellpadding="0">
- <tr>
- <td height="26" colspan="2">Your Profile Information </td>
- <td><div align="right"><a href="index.php">logout</a></div></td>
- </tr>
- <tr>
- <td width="129" rowspan="5"><img src="<?php echo $picture ?>" width="129" height="129" alt="no image found"/></td>
- <td width="82" valign="top"><div align="left">FirstName:</div></td>
- <td width="165" valign="top"><?php echo $fname ?></td>
- </tr>
- <tr>
- <td valign="top"><div align="left">LastName:</div></td>
- <td valign="top"><?php echo $lname ?></td>
- </tr>
- <tr>
- <td valign="top"><div align="left">Gender:</div></td>
- <td valign="top"><?php echo $gender ?></td>
- </tr>
- <tr>
- <td valign="top"><div align="left">Address:</div></td>
- <td valign="top"><?php echo $address ?></td>
- </tr>
- <tr>
- <td valign="top"><div align="left">Contact No.: </div></td>
- <td valign="top"><?php echo $contact ?></td>
- </tr>
- </table>
- <p align="center"><a href="index.php"></a></p>
Comments
This is really brilliant....
Thnku sooo much for this code.....after getting this code. i solved my problem after 10 days.. soo again thnks
How to Create Profile Information Page in PHP/MySQL
Hi! =) kindly next time put some complete download source sir/ma'am for this tutorial even if it's only a short code. but this is great! I lav it ^_^
home.php
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
Great but two questions
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
picture upload
plzzz suggest me about picture upload in registration form, and showing in home page or profile page.
home.php Problem Soloution
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
tried nd tried to find d error bt i cant find it plssss helpppp
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
you need this script for real profle
- <?php
- $local_host = 'localhost'; //host doman.com
- $db_host = $local_host;
- $db_user = 'root'; // database username
- $user = $db_user;
- $db_pass = ''; //db password
- $pass = $db_pass;
- $db_name = 'member'; //
- $db = $db_name;
- // connect to mysql
- $sql = "SELECT * FROM user";
- $username = $row['username'];
- $time = $row ['time'];
- //make a user link when you click in any user this link well open his profile
- echo '<div style="font-size:18px; color:blue; margin-top:-5px;" ><a href="profile.php?'.$_COOKIE['user'].'">'.$username.'</a></div>';
- //$n = $_REQUEST[$time];
- //setcookie('user','manassa');
- }
- ?>
- <?php
- if($_REQUEST['user'] == $_COOKIE['user'] || $_COOKIE['user'] == 'Admin'){
- echo'<form action="settings.php">
- <input id="button" type="submit" value="Settings V"/>
- <input id="button" type="submit" value="massege"/>
- </form>';
- }
- elseif($_REQUEST['user'] == 'user'){
- //header("location:profile.php");
- }
- else
- {
- echo'<form action="follow.php">
- <input id="button" type="submit" value="follow +"/>
- <input id="button" type="submit" value="massege"/>
- </form>';
- }
- }
- ?>
- </div>
- </div>
- <?php
- //$man = $_GET[$username]
- echo $_REQUEST['user']."Profile"; //code here
- // class information ()/{ // this function To Get profile Information!
- $user = $_REQUEST['user'];
- $sql = "SELECT * FROM user WHERE username='$user'" ;
- {
- $username = $rows ['username'];
- /* $Email = $rows ['Email'];
- $pass = $rows ['time'];
- $quetion = $rows ['quetions'];
- $answer = $rows ['answer']; */
- /*echo "<br/>".$username;
- echo "<br/>".$Email;
- echo "<br/>".$pass;
- echo "<br/>".$quetion;
- echo "<br/>".$answer;
- */
- }
- }
- else
- {
- }
- ?>
thanks tht helped a lot.. but
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
How to Make Fields Editable
Hi is it possible to make these fields editable
example user during signup entered wrong telephone number and wants to change it.
error while accessing loggedin user's profile
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 $num) {
$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++;
}
Not displaying fetched Data from the database in the profile
Please this code is not fetching data in my profile.php.
Can any one help?
Your Profile Information | ||
FirstName: |
||
LastName: |
||
Gender: |
||
Address: |
||
Contact No.: |
personal objective suggest about this website
Hello everyone. I would to present my personal objective suggest about this website. It is good category? warteesy. Regards
Lahko pomagam pri razvoju foruma
I am from Slovenia. I can help with build this forum. Thanks for approved.
Jaz sem Slovenka. Lahko pomagam pri razvoju foruma.
Im newbies i cant find the code
I'm new here in sourcecodester, i can't see the code for creating profile information
Add new comment
- Add new comment
- 20693 views