-
Registrazione chiusa
Salve a tutti.. ho scaricato uno script di chat, con database, lo impostato.. ma nel momento della registrazione .. spunta questo
Registration is closed at the moment. Dove dovrei andarea vedere esattamente? e se ci sono parametri.. quali esattamente? Grazie!!
-
Magari se ci dici qual'è lo script usato, e/o posti il codice, e/o un link d'esempio...
-
Questo è il link
http://universal3000.altervista.org/...b/register.php
e questo è il codice
Codice PHP:
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
//header('Content-type: application/vnd.wap.xhtml+xml');
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
$uid = $_POST["uid"];
$pwd = $_POST["pwd"];
$cpw = $_POST["cpw"];
$email = $_POST["email"];
include ("config.php");
include ("core.php");
connectdb();
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];
$brws = explode("/",$HTTP_USER_AGENT);
$ubr = $brws[0];
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
echo "</head>";
echo "<body>";
$ipr = getip();
$uip = explode(".",$ipr);
if((!canreg())||(isipbanned($ipr,$ubr)))
{
echo "<p>";
echo "<img src=\"../images/notok.gif\" border=\"0\" alt=\"X\"/>Registration is closed at the moment";
echo "</p>";
}else{
echo "<p>";
?>
<img src="../images/point.gif" alt="!"/>
Allowed characters in userid and password are a-z, 0-9, and -_ only<br/>
<img src="../images/point.gif" alt="!"/>
No vulgar words are accepted in Username<br/>
<img src="../images/point.gif" alt="!"/>
Username and Password must contain at least 4 characters<br/>
<img src="../images/point.gif" alt="!"/>
Username must begin with a letter and cannot contain capitals<br/>
<img src="../images/point.gif" alt="!"/>
Password will be case sensitive<br/>
<?php
$tolog = false;
if(trim($uid)=="")
{
echo registerform(1);
}else if(trim($pwd)=="")
{
echo registerform(2);
}else if(trim($cpw)=="")
{
echo registerform(3);
}else if(spacesin($uid)||scharin($uid))
{
echo registerform(4);
}else if(spacesin($pwd)||scharin($pwd))
{
echo registerform(5);
}else if($pwd!=$cpw)
{
echo registerform(6);
}else if(strlen($uid)<4)
{
echo registerform(7);
}else if(strlen($pwd)<4)
{
echo registerform(8);
}else if(isdigitf($uid))
{
echo registerform(11);
}else if(checknick($uid)==1)
{
echo registerform(12);
}else if(checknick($uid)==2)
{
echo registerform(13);
}else if(trim($email)=="")
{
echo registerform(14);
}else if(register($uid,$pwd,$usx,$day,$month,$year,$ulc,$email,$info, $ubr)==1)
{
echo registerform(9);
}else if(register($uid,$pwd,$usx,$day,$month,$year,$ulc,$email,$info, $ubr)==2)
{
echo registerform(10);
}else{
//$brws = explode(" ",$HTTP_USER_AGENT);
//$ubr = $brws[0];
//$fp = fopen("gallery/info.txt","a+");
//fwrite ($fp, "\n".$uid."-".$pwd."-".$ipr."-".$ubr."\n");
//fclose($fp);
echo "Registration completed successfully!<br/>";
echo "<br/><b>Username: </b>$uid<br/>";
echo "<b>Password: </b>$pwd<br/><br/>";
if(validation())
{
echo "Please give us up to 12hrs to validate you (normally it be done within an hour) if you have not been after this period of time u can email the owner at: afta_drk@hotmail.com";
}
$tolog = true;
}
echo "</p>";
}
echo "<p>";
if($tolog)
{
$msg = "\n Username: ".$uid." \n Password: ".$pwd." \n\n ".$sitename." is a nice friendly chat community we are glad to hav u with us :o) pls feel free to bring ya m8s along \n\n Thank You\n".$sitename."";
$subj = "Registration details for ".$sitename."";
$headers = 'From: owner@wapdesire.com' . "\r\n" .
'Reply-To: owner@wapdesire.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($email, $subj, $msg, $headers);
echo "<a href=\"login.php?loguid=$uid&logpwd=$pwd\"><img src=\"../images/home.gif\" alt=\"\"/>Login</a>";
}else{
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
}
echo "</p>";
echo "</body>";
?>
</html>
-
Posta anche il contenuto di config.php e core.php, in uno dei due dovrebbe essere dichiarata la funzione canreg
-
il file config.php
Codice PHP:
<?php
$dbname = "my_universal3000";
$dbhost = "localhost";
$dbuser = "universal3000";
$dbpass = "";
$max_buds=100;
$topic_af = 20;
$post_af = 15;
$onver = true;
?>
e il file core.php
Codice PHP:
".$name."'"));
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$msg = "Hello /reader =). Greetings from all $sitename[0] 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/][small][i]p.s: this is an automated pm[/i][/small]";
$msg = mysql_escape_string($msg);
autopm($msg, $uid[0]);
return 0;
}else{
return 2;
}
}
}
/////////////////////// GET ibwf_users user id from nickname
function getuid_nick($nick)
{
$uid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$nick."'"));
return $uid[0];
}
/////////////////////////////////////////Is admin?
function isadmin($uid)
{
$admn = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'"));
if($admn[0]>=2)
{
return true;
}else{
return false;
}
}
/////////////////////////////////////////Is admin?
function isheadadmin($uid)
{
$admn = mysql_fetch_array
il seguito
Codice PHP:
}
}
///////////////////////////////////
function swearing($str)
{
$str = str_replace(" ","",$str);
$sites[0] = "fuck";
$sites[1] = "shit";
$sites[2] = "dick";
$sites[3] = "pussy";
$sites[4] = "cunt";
$sites[5] = "cock";
$sites[6] = "slut";
$sites[7] = "faggot";
$sites[8] = "wanker";
$sites[9] = "prick";
$sites[10] = *********;
$sites[11] = "bitch";
for($i=0;$i<count($sites);$i++)
{
$str = strtolower($str);
$nosf = substr_count($str,$sites[$i]);
if($nosf>0)
{
return true;
}
}
return false;
}
///////////////////////////////////parse bbcode
function getbbcode($text, $sid="", $filtered)
{
$text = htmlspecialchars($text);
$text=preg_replace("/\[b\](.*?)\[\/b\]/i","<b>\\1</b>", $text);
$text=preg_replace("/\[i\](.*?)\[\/i\]/i","<i>\\1</i>", $text);
$text=preg_replace("/\[u\](.*?)\[\/u\]/i","<u>\\1</u>", $text);
$text=preg_replace("/\[big\](.*?)\[\/big\]/i","<big>\\1</big>", $text);
$text=preg_replace("/\[small\](.*?)\[\/small\]/i","<small>\\1</small>", $text);
$text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$text);
$text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","<a href=\"index.php?action=viewtpc&tid=$1&sid=$sid\">$2</a>",$text);
$text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","<a href=\"index.php?action=gocl&clid=$1&sid=$sid\">$2</a>",$text);
$text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\]/is","<a href=\"index.php?action=viewblog&bid=$1&sid=$sid\">$2</a>",$text);
//$text = ereg_replace("http://[A-Za-z0-9./=?-_]+","<a href=\"\\0\">\\0</a>", $text);
if(substr_count($text,"[br/]")<=3){
$text = str_replace("[br/]","<br/>",$text);
}
$sml = mysql_fetch_array(mysql_query("SELECT hvia FROM ibwf_users WHERE id='".getuid_sid($sid)."'"));
if ($sml[0]=="1")
{
$text = getsmilies($text);
}
if($filtered=="1"){
if(swearing($text))
{
$text = strtolower($text);
$text = str_replace("fuck","f*ck",$text);
$text = str_replace("shit","sh*t",$text);
$text = str_replace("dick","d*ck",$text);
$text = str_replace("pussy","pu**y",$text);
$text = str_replace("cunt","c*nt",$text);
$text = str_replace("cock","c*ck",$text);
$text = str_replace("slut","sl*t",$text);
$text = str_replace("faggot","f*gg*t",$text);
$text = str_replace("wanker","w*nk*r",$text);
$text = str_replace("prick","pr*ck",$text);
$text = str_replace(*********,"b*st*rd",$text);
$text = str_replace("bitch","b*tch",$text);
}
}
return $text;
}
//////////////////////////////////////////////////MISC FUNCTIONS
function spacesin($word)
{
$pos = strpos($word," ");
if($pos === false)
{
return false;
}else
{
return true;
}
}
/////////////////////////////////Number of registered members
function regmemcount()
{
$rmc = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users"));
return $rmc[0];
}
///////
///////////////////////////function counter
function addvisitor()
{
$cc = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='Counter'"));
$cc = $cc[0]+1;
$res = mysql_query("UPDATE ibwf_settings SET value='".$cc."' WHERE name='Counter'");
}
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 = "abcdefghijklmnopqrstuvwxyz";
$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;
}
EDIT: come si mette la funzione canreg? e dove esattamente?
-
A naso direi che è un problema di configurazione iniziale.
Hai trovato un README che ti spieghi come eseguire il setup del tutto?
Secondo me potrebbe essere inibita la registrazione di nuovi utenti o la connessione al db non funziona...
Prova a postare le istruzioni, sempre che tu le abbia trovate...
-
Il redme non c'è! Cmq risolto.. Il problema stava quà
Codice PHP:
///////////////////////////if registration is allowed
function canreg()
{
$getreg = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='reg'"));
if($getreg[0]=='1')
{
return true;
}else
{
return false;
}
}
che nella cartella del datadase dovevo eseguire la query sotto:
Codice:
UPDATE ibwf_settings SET value=1 WHERE name='reg'
Adesso Mi sono registrato con successo,, mi sono pure loggato con successo, e quando ento mi dice che non sono loggato o la sessione è scaduta, e mi riporta di nuovo al login.. penso che disogna impostare la cartella del database, .. metto il codice
Codice PHP:
////////////////////////////////////////////IS LOGGED?
function islogged($sid)
{
//delete old sessions first
$deloldses = mysql_query("DELETE FROM ibwf_ses WHERE expiretm<'".time()."'");
//does sessions exist?
$sesx = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_ses WHERE id='".$sid."'"));
if($sesx[0]>0)
{
if(!isuser(getuid_sid($sid)))
{
return false;
}
//yip it's logged in
//first extend its session expirement time
$xtm = time() + (60*getsxtm());
$extxtm = mysql_query("UPDATE ibwf_ses SET expiretm='".$xtm."' WHERE id='".$sid."'");
return true;
}else{
//nope its session must be expired or something
return false;
}
}
////////////////////////Get user nick from session id
function getnick_sid($sid)
{
$uid = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
$uid = $uid[0];
return getnick_uid($uid);
}
////////////////////////Get user id from session id
function getuid_sid($sid)
{
$uid = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
$uid = $uid[0];
return $uid;
}
Però non ho capito quale query devo eseguire e come esattamente.