anti double account signup

Started by rickandmary, July 20, 2012, 12:49:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Add login funtcion logincooke

setcookie("dupla", "yes", "0x7fffffff", "/");

add signup.php
require_once next line

stderr("Warning","Diséabed duppe accunt signup");*/
Music and PHP programing base.


This performs a cookie and ip check on registration to stop  people making multiple accounts.

On file takeupload.php find
// do simple proxy check
if (isproxy())
bark("You appear to be connecting through a proxy server. Your organization or ISP may use a transparent caching HTTP proxy. Please try and access the site on <a href=>port 81</a> (this should bypass the proxy server). <p><b>Note:</b> if you run an Internet-accessible web server on the local machine you need to shut it down until the sign-up is complete.");

and below add

//---IP checkup
$ip_ = (@mysql_fetch_row(@mysql_query("select count(*) from users where ip='" . $_SERVER["REMOTE_ADDR"] . "'"))) or die(mysql_error());
if ($ip_[0] != 0)
bark("The ip " . $_SERVER['REMOTE_ADDR'] . " is already in use.");

//---COOKIE checkup
if (isset($_COOKIE["uid"]) && is_numeric($_COOKIE["uid"]) && !empty($_COOKIE["uid"])) {
    $cid = intval($_COOKIE["uid"]);
    $c = mysql_query("SELECT enabled FROM users WHERE id = $cid ORDER BY id DESC LIMIT 1");
    $co = @mysql_fetch_row($c);
    if ($co[0] == 'no') {
        sql_query("UPDATE users SET ip = ".getip().", last_access = '" . get_date_time() . "' WHERE id = $cid");
        bark("Your's IP is banned. Registration not allowed.");
    } else
        bark("Registration not allowed!");
} else {
    $b = (@mysql_fetch_row(@mysql_query("SELECT enabled, id FROM users WHERE ip LIKE '%".getip()."%' ORDER BY last_access DESC LIMIT 1")));
    if ($b[0] == 'no') {
        $banned_id = $b[1];
        setcookie("uid", $banned_id, "0x7fffffff", "/");
        bark("Your's IP is banned. Registration not allowed.");

I am not sure who made this mod but all credit to the author, thanks for this