confirmation code in registration form

They have: 2 posts

Joined: Feb 2011

Hi, i hope im posting in the correct forum,

I just started learning php and stuff a few days ago and am using the scripts from phpsense.com/php/php-login-script.html
for my login and registration forms but i wanted to add a field in the registration form that requires a confirmation code, that i would give out to certain people, to keep just any random person from being able to register and gaining access to my site. The way it is now, kinda makes me feel like the login screen is useless as any one that wants to take 5 extra seconds to register can gain access. Ive searched google for how to do this but all i get is that gay captcha stuff.

They have: 2 posts

Joined: Feb 2011

Ok i found a work around for what i wanted kinda, but im not sure if its the best way to do it or not. i made a separate login page for it with 1 field that checks against my table in my mysql database, instead of adding the field to the registration form its self.

jessicaellen's picture

They have: 31 posts

Joined: Nov 2010

Here is the complete Code for a registration form code check it.
<?PHP

require_once("./include/membersite_config.php");

if(isset($_GET['code']))

{

if($fgmembersite->ConfirmUser())

{

$fgmembersite->RedirectToURL("thank-you-regd.html");

}

}

?>

Confirm registration

Confirm registration

Please enter the confirmation code in the box below

* required fields

<?php
echo $fgmembersite->GetErrorMessage();
?>

Confirmation Code:*

//

jessicaellen's picture

They have: 31 posts

Joined: Nov 2010

<?PHP

require_once("./include/membersite_config.php");

if(isset($_GET['code']))

{

if($fgmembersite->ConfirmUser())

{

$fgmembersite->RedirectToURL("thank-you-regd.html");

}

}

?>

Confirm registration

Confirm registration

Please enter the confirmation code in the box below

* required fields

<?php
echo $fgmembersite->GetErrorMessage();
?>

Confirmation Code:*

//

They have: 4 posts

Joined: Jun 2011

The best way to do this is to use java script for this or else if you just want to avoid bots to register automatically try CAPTCHA- any image validation scripts. This is the easiest way to do this.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.