Question

I've tried searching for showing account verified message once technique but in vain.. Instead i get how to verify account blogs.. I've already written a code where when the admin validates a account the user gets a message that his account has been verified.. But i just want to show this message once and not the next time he visits his home page.. I've made a jsfiddle of my code for convenience.. There is a php code but obviously that wont run on jsfiddle but you can check how I'm trying to show that message..

http://jsfiddle.net/shettyrahul8june/JX6S7/

Code:

<div>
<span> ADD PROJECT</span><br />
<FORM action="addpro.php" method="post">
    <lable>DEPARTMENT</lable>&nbsp;<input name="dep" type="text" required autofocus placeholder="Department"/><br /><br />
    <lable>PROJECT TITLE</lable>&nbsp;<input name="project" type="text" required autofocus placeholder="PROJECT TITLE"/><br /><br />
    <label>GUIDE</label>&nbsp;<input name="guide" type="text" required  placeholder="Guide"/><br /><br />
    <label>TEAM MEMBERS</label>
    <input name="m1" type="text" required  placeholder="name 1"/>
    <input name="m2" type="text" required  placeholder="name 2"/>
    <input name="m3" type="text"   placeholder="name 3"/>
    <input name="m4" type="text"   placeholder="name 4"/><br /><br />
    <label>DESCRIPTION</label><textarea name="desc">Type here</textarea><br /><br />
    <input type="submit" value="ADD"/><br />
</FORM>

<br /><a href="logout.php">LOGOUT</a>

I've checked stack overflow plus the suggestion i got while typing the title but none solved the query.. Another problem is when the user submits the user data on the home page, he should be redirected to another page after login and not the same home page which I've uploaded on JSfiddle.. That is my home page when user logs in.. But if he successfully submits the form at the first time after that i want him to be redirected to another page the next time he logs in.. i do not expect people to write code for me. Just links and pseudo code explanation will also do... Thanks in advance and i hope this question proves helpful to others.

Was it helpful?

Solution

You can use the below idea how to implement it.

If you are saving user's last login date then check for it. If last login date is null or empty then only show Account Verification Message otherwise not. Because when user logs in first time then last login date will be null or empty.

If you do not save last login date then you can use a flag in table and check whether user logs in for first time or not and accordingly you can show message.

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