Hide email?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JakkyD
Forum Newbie
Posts: 4
Joined: Tue Jul 08, 2008 2:37 pm

Hide email?

Post by JakkyD »

Hi. I have a login system. There are 2 files called useredit.php and userinfo.php.
useredit.php is where users can edit their information and userinfo.php is viewing users information.
I was wondering if there was a function or something where users on useredit.php could tick a box or something which will not display there email address on userinfo.php.

I could just remove the code which displays the users email but it would be better if that could be optional.

Does anyone have a solution or can lead me in the direction?

I searched google but couldnt find anything.

Thanks a lot.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Hide email?

Post by jaoudestudios »

The answer is Yes.

Add a checkbox to your edit page. Have the value of it set to 1. Add a new column to the database. When they check that box get it to save the 1 to the relevant column.

On the other page that displays the information, use a if statement to check if there is a 1 in the database for that user, then dont execute that code that displays the user's email.
Post Reply