Hello All,

I am new user to this community as well to PHP. I have designed a website. Now i am stuck with a problem here. I have added some new fields into my database. i want to add a script whcih works like this:
Whenever a user login to his account,script automatically checks that all the data is filled in database for that user or not, if something is not missing then user can be forwarded to his normal page and if something is missing then a box will open showing a message to update the profile for following field(then displays the field). Same script should be able o update the missing fields to database.
That dialogue box should have skip button to so that user can do it later. But that dialouge box should appear on each login till the fields are filled.

I know its a complicated script and i have tried my best to create it. Now i need a genius from you who can help me on this please.


Two ways the query could work (depending on your database design):
Your database query could be a query to return everything from the users table for that login.
You then parse that result set to locate an empty elements and if any are found display the alert box.

Or, query for all fields in the database that are '' or NULL. If anything is returned then you know to bring up the alert box.

Once the user has clicked the link to complete their profile you can either show just the empty fields or show everything to allow them to make changes to every field. Save the changes to the database.

You mention it should be the same script that does all this but it doesn't have to be and preferrably won't be. You want one script to detect empty fields, if any show message to take user to editing page.
From that page second script runs the update.

commented: can't get tighter answer than this Kudos +13
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.