Link to home
Start Free TrialLog in
Avatar of PunkRokAdrenalin
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.
ASKER CERTIFIED SOLUTION
Avatar of cr4ck3rj4ck
cr4ck3rj4ck
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mankowitz
That's a pretty tall order. I don't know of any premade stuff, but here is some pseudocode

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)==0) {
// 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;
}
Avatar of PunkRokAdrenalin
PunkRokAdrenalin

ASKER

Hey guys,
Thank you so much for the help. The form is up and running and has successfully invited 800+ people!
You rock thanks for the codes and help!