Question

I would like to install on my website a «verefied account» feature. But I wondered what was the best way to get there, with MySQL and PHP?

I tried to put a column «verified», in witch I post the badge picture name (verified.png), but by doing it this way, users with no verified account saw the space occupied by the badge, with empty space with an X in the upper left corner.

So, any idea on the best way to achieve this?

Thanks!

Was it helpful?

Solution

You need to go deeper. You are missing huge part of web design and PHP.

What's the correct way too implement this?

1- Add a Boolean/Bit "Verified" Column 0/1

2- In your PHP page, you need a simple condition:

If(Column("Verified") == True) {
 echo '<img src=\"verified.png\" />'
} else { 
   //Nothing! 
}

OTHER TIPS

Create a column verified_account in your users table. When you want to validate an account, you should add something like YES or NO to the proper user. Then, on your page, you only have to call something like:

SELECT verified_account FROM users WHERE ID = $session_id
IF verified_account = YES
echo = YOUR_IMAGE_HERE

you can try to add a row to your mysql database that is of type ENUM, and set it value to 0 if not verified, and 1 if verified. Then check the value of the ENUM for that particular user and if it is one, display the image.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top