Originally posted by DarkRaven
View Post
PHP Code:
<?php
function registration()
{
$sql="select * from settings where name='registration'";
$query=mysql_query($sql);
$array=mysql_fetch_array($query);
if($array["value"]=='1'){return true;}
else{return false;}
}
function spacesin($word)
{
$pos=strpos($word," ");
if($pos===false)
{
return false;
}
else
{
return true;
}
}
function scharin($word)
{
$chars="abcdefghijklmnopqrstuvwxyz0123456789-_";
for($i=0;$i<strlen($word);$i++)
{
$ch=substr($word,$i,1);
$nol=substr_count($chars,$ch);
if($nol==0)
{
return true;
}
}
return false;
}
function isdigitf($word)
{
$chars="abcdefghijklmnopqrstuvwxyz0123456789";
$ch=substr($word,0,1);
$sres=ereg("[0-9]",$ch);
$ch=substr($word,0,1);
$nol=substr_count($chars,$ch);
if($nol==0){return true;}
return false;
}
function checknick($uid)
{
$chk=0;
$uid=strtolower($uid);
$nick=mysql_fetch_array(mysql_query("SELECT id, name, nicklvl FROM nicks WHERE name='".$uid."'"));
if($nick[0]!=""){$chk=$nick[2];}
return $chk;
}
function register($name,$pass,$usex,$email)
{
$execms=mysql_query("SELECT * FROM users WHERE username='".$name."'");
if(mysql_num_rows($execms)>0){return 1;}
else{
$pass=md5($pass);
$validation=mysql_fetch_array(mysql_query("SELECT value FROM settings WHERE name='validation'"));
if($validation[0]==1){$validated=0;}
else{$validated=1;}
$reg=mysql_query("INSERT INTO users SET username='".$name."', password='".$pass."', regdate='".time()."', validated='".$validated."', ipaddress='".ip()."', browser='".browser()."', host='".subno()."'");
$pro=mysql_query("INSERT INTO profiles SET uid='".getuid_nick($name)."', sex='".$usex."', email='".$email."', script='xhtml'");
if(($reg)&&($pro)){
addonline(getuid_nick($name),"Just Registered","");
$delonline=mysql_query("DELETE FROM online WHERE uid='".getuid_nick($name)."'");
$msg="Hello /reader =). Greetings from all ".sitename()." staff, we are happy to have you here, welcome to our big happy family!, If You Have any questions or comments about the site feel free to message me or any of the other staff members online. ENJOY!(excited)[br/] u can gain points by using forums and chat wich will unlock other site parts bare in mind that site is stil under construction but where up and running finally YaY :o)[small][i][br/]p.s: this is an automated pm[/i][/small]";
$msg=mysql_escape_string($msg);
autopm($msg,getuid_nick($name));
return 0;
}else{
return 2;
}
}
}
?>
php_flag register_globals? theres none
Comment