uberCMS - - Limited Accounts Registered

Linkestt

Truth is treason in the empire of lies
Nov 8, 2013
376
206
I need the script to limit the accounts that can register per IP address.
I found this code from a rival forum, but when it's entered in my register page the page goes blank (all white).

Is there something missing in the code? If so, please help. Or find the script for me. (y)

Code:
<?php $sql = mysql_query("SELECT * FROM users WHERE ip_last='$_SERVER[REMOTE_ADDR]'");
if(mysql_num_rows($sql) > 0) {
echo '<script type="text/javascript">
<!--

alert ("You can only create 1 account per IP!")

// -->
</script>';
echo '<meta http-equiv="refresh" content="1 url=index.php"> ';
die;
}

?>
 

JayC

Always Learning
Aug 8, 2013
5,497
1,398
if (mysql_num_rows(mysql_query("SELECT * FROM users WHERE ip_last = '" . $_SERVER["REMOTE_ADDR"] . "'")) > 9)
{
die('<h1>Hold up!</h2><hr>You have way too many accounts. You are not allowed any more.');
}

if (LOGGED_IN)
{
header("Location: " . WWW . "/me");
exit;
}
 

Proximity

IDK?
Feb 13, 2014
673
56
Code:
<?php $sql = mysql_query("SELECT * FROM users WHERE ip_last='$_SERVER[REMOTE_ADDR]'");
if(mysql_num_rows($sql) > 0) {
echo '<script type="text/javascript">


alert ("You can only create 1 account per IP!")


</script>';
echo '<meta http-equiv="refresh" content="1 url=index.php"> ';
die;
}

?>
you have
<!--
// -->
 

JayC

Always Learning
Aug 8, 2013
5,497
1,398
Code:
<?php $sql = mysql_query("SELECT * FROM users WHERE ip_last='$_SERVER[REMOTE_ADDR]'");
if(mysql_num_rows($sql) > 0) {
echo '<script type="text/javascript">


alert ("You can only create 1 account per IP!")


</script>';
echo '<meta http-equiv="refresh" content="1 url=index.php"> ';
die;
}

?>
you have
<!--
// -->
Didn't see the <!-- and --> but yeah Elyk is right, that would be commenting it out if it was right thing... lol
<!-- doesn't comment php files
/* This is a multi line comment
yet another line of comment */
// This is a one-line style comment
 

Users who are viewing this thread

Top