How Do I Show Only the Logged In Users Info

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

Tue Oct 02, 2012 4:09 pm

I am a newbie and i created a member site with php and mysql in expression web. I would like each member to be able to view their profile information and be able to update it . For example they click a link that says my profile and their info comes up in a form for them to view and/or edit and update it.
Links to tutorials are always greatly appreciated since i am no good at coding... ;)

php-forum Fan User
php-forum Fan User
Posts: 974
Joined: Mon Oct 01, 2012 12:32 pm

Wed Oct 03, 2012 8:31 am

personally i'd do it in one page like:

Code: Select all

if (! isset($_GET['change'])) { //not trying to edit just display
	<!-- html code to display profile -->
	<?php if ($_SESSION['user_id']==$displayed_id) { ?>
		<a href="whatever.php?change=1>Edit your details</a>
<?php } else { //change has been set by user clicking edit link ?>
	<!-- html code to show edit form -->

*** edit ***
fixed typo sorry

Post Reply