PunkRokAdrenalin
asked on
PHP Invite system.
Hey Experts,
I'm in need of a invite system. The web page I am designing will have a password protection and the password will only be given out to a few select people. Once they are in the site I want them to be able to enter in three e-mail addresses to send invites that have randomly generated passwords which can only be used once... I have know idea how to do this and any pre-made stuff or templates. AND if it could be in PHP that would be good but it doesn't have to be.
I'm in need of a invite system. The web page I am designing will have a password protection and the password will only be given out to a few select people. Once they are in the site I want them to be able to enter in three e-mail addresses to send invites that have randomly generated passwords which can only be used once... I have know idea how to do this and any pre-made stuff or templates. AND if it could be in PHP that would be good but it doesn't have to be.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hey guys,
Thank you so much for the help. The form is up and running and has successfully invited 800+ people!
Thank you so much for the help. The form is up and running and has successfully invited 800+ people!
ASKER
You rock thanks for the codes and help!
if (!$_POST) {
show regular welcome page, with <INPUT TYPE=PASSWORD NAME=PASS>
}
else if($_POST['pass'] == "master password") {
allow user to select 3 emails
}
else
{ //check db for password
SELECT * FROM invites WHERE pw=$_POST['pass'];
if (mysql_num_rows($result)==
// password is wrong .. try again}
else {
DELETE FROM invites WHERE $pw=$_POST['pass'];
}
function make_password() {
for ($d=0; $d<10; $d++) {
$pw .= chr(rand(1,26)+64);
}
INSERT INTO invites (pw) VALUES ('$pw')
return $pw;
}