FlyingIsFun1217 Posted January 13, 2009 Share Posted January 13, 2009 Hey! So, what I've got is a private system, but I need people to be able to register for it. What I'd like to do is somehow let the Administrator set up an account with a username and email, but let the user set his own password, instead of having to give it to the administrator. I can't really think of any solutions to this. Is there a way to verify an incoming visit from a certain email address? And would that really be a secure way of dealing with it? Would it be just as secure for the server to create a random string for a url like http://www.website.com/signup.php?eid=23n2j3b23j, and send that to the user, and check to see that it's the url the person is going to? Guess I'm just looking for some ideas for solutions. Thanks! FlyingIsFun1217 Quote Link to comment Share on other sites More sharing options...
ngreenwood6 Posted January 13, 2009 Share Posted January 13, 2009 What I would do in your situation is create 2 fields in the database both with an int type. Then when the Administrator puts in the username and email it puts a random number in the database using the rand() function, while it puts that random number in the database it also emails that in the link (http://mysite.com/create_password.php?random=randomnumber). Also, when it registers the user it puts a 0(telling whether they are registered or not) in the database under the other int value that you created. Now when the user clicks the link in the database it will allow them to enter a password (finding them by the random number and the 0 in the database). When they enter the password it then sets the 0 to a 1 saying that they are registered that way they cannot keep clicking the password link and the random number will not show up if you test for both the random and the registered value. Hopefully that makes sense. If you have any questions feel free to ask. Quote Link to comment Share on other sites More sharing options...
FlyingIsFun1217 Posted January 13, 2009 Author Share Posted January 13, 2009 Cool. It seemed like a decent method to me, but it was sort of a last minute thought as I was posting, and wasn't sure if it was really viable. I'll try it out! Thanks! FlyingIsFun1217 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.