Page 1 of 1

Hide email?

Posted: Wed Jul 16, 2008 10:05 am
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.

Re: Hide email?

Posted: Wed Jul 16, 2008 1:29 pm
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.