Jump to content

How can i do make invitation only site?


richwininc

Recommended Posts

I want to make it to where you can get into the site or register without a invitation from another member. When you type the url in i want to go to a page where it just explains the site(which i already made) a place for invitation code input, and a place to log in (which i got this part)

Link to comment
Share on other sites

ok I have a affiliate program that i have started with some celebrity speakers and I want to make it to where when they do a e-mail promotion the affiliate has a invitation code in their, and when the customer clicks comes to the site they have to enter that invitation code to get in.

Like when google analytics came out you have to enter a certain code to get in and its a different code for everyone.  I want to make like to where each affiliate has a invite code they can use.

I dont know if that makes since or not...
Link to comment
Share on other sites

[code]
<?
if (empty($_GET[user_id])) { $user_id = $_POST[user_id]; } else $user_id = $_GET[user_id];
if (empty($_GET[code])) { $code = $_POST[code]; } else $code = $_GET[code];

if (!empty($user_id) && !empty($code) ) {
$q = mysql_query("SELECT * FROM confirm WHERE user_id = '$user_id' AND code = '$code' LIMIT 1");
$z = mysql_fetch_array($q);

if (mysql_num_rows($q) == 1) {

$user_level = 0;
$username = $z[username];
$password = $z[password];
$email = $z[email];

$insert = mysql_query("INSERT INTO users (user_id,user_level,username,password,email)
VALUES ('".$user_id."','".$user_level."','".$username."','".$password."','".$email."') ");

$del =  mysql_query("DELETE FROM confirm WHERE user_id = '$user_id' LIMIT 1");

if ($insert && $del) {

msg_it ("Congratulation!","Your validation successfully done. Now you can login with your username and password!");

} else echo mysql_error();



} else {
msg_it("Error","Invalid USER_ID or CONFIRMATION CODE");
}


} else {

echo '<form method="POST" action="?fid=html&page=confirm">

<table width="600" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="2" align="left" bgcolor="#FFA029"><strong>Validation</strong></td>
      </tr>
   

  <tr>
        <td colspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td width="100"><strong>User_ID:</strong></td>
        <td><input name="user_id" type="text" class="reg_form"  maxlength="3"></td>
      </tr>
      <tr>
        <td><strong>CODE:</strong></td>
        <td><input name="code" type="text" class="reg_form" maxlength="80"></td>
      </tr>
      <tr>
  <td>&nbsp;</td>
        <td><input type="image" src="images/buttons/validate.png" /></td>
      </tr>
    </table>


</form>';

}

?>
[/code][/code][/code][/code]
Link to comment
Share on other sites

You have no choice but to have the affiliates put that in the database.  You just have a database full of all the accepted codes, have your affiliates feed you the code, or whoever, when they get it enter it into a database, then only the codes in the database, will allow access.
Link to comment
Share on other sites

No i dont know php at all only html.....  oh ok so do i need to create a new database aside from the one i have and put the codes in there?  Thanks for the form... Do i just input that in the page i'm building and load the codes in the database and send the codes to the affiliates i want to have it?

Thanks for the help thus far
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.