• User Attivo

  • ModSenior

    [php]
    <?php
    require_once "includes/config.php";
    require_once "includes/mysql_connect.php";
    require_once "includes/getsett.php";
    require_once "includes/funzioni.php";
    if(trim($arr_impostazioni['lingua'])=="" || !is_dir("lang/".$arr_impostazioni['lingua'])){ $arr_impostazioni['lingua']="ita"; }
    require_once "lang/".$arr_impostazioni['lingua']."/login.php";
    $actlog=(isset($_GET['actlog'])) ? $_GET['actlog'] : $_POST['actlog'];

    if($actlog=="entra"){
    if(user_esistente=="si"){
    if(my_bannato=="si"){
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr class="tabcat">
    <td colspan="4" class="testo12">".sei_bannato.".<br /><br />
    <a href="mailto:".$arr_impostazioni['mailsito']."">".contatta_admin.".</a></td>
    </tr>
    </table>";
    }else{
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr class="tabcat">
    <td colspan="4" class="testo12">".gia_loggato.".</td>
    </tr>
    </table>";
    }
    }else{
    $username=mysql_escape_string($_POST['username']);
    $passw=mysql_escape_string($_POST['passw']);
    $username=str_replace("%","",$username);
    $passw=str_replace("%","",$passw);
    $q_l_entra=quera("SELECT id,nome,livello,attivazione
    FROM ".$tblprefix."users WHERE nome='$username' AND psw='".md5($passw)."' LIMIT 1");
    if(mysql_num_rows($q_l_entra)==1){
    $arr_entrato=mysql_fetch_assoc($q_l_entra);
    $l_id=$arr_entrato['id'];
    $l_nome=$arr_entrato['nome'];
    $l_livello=$arr_entrato['livello'];
    $l_attivazione=$arr_entrato['attivazione'];
    if($l_attivazione == '1') {
    //$rootcookie=$_SERVER['HTTP_HOST'];
    //$rootcookie=str_replace("www.","",$rootcookie);
    setcookie("denome","$l_nome",time()+(86400365),"/");
    setcookie("depsw",md5($passw),time()+(86400
    365),"/");
    quera("DELETE FROM ".$tblprefix."online WHERE ip='".$_SERVER['REMOTE_ADDR']."' LIMIT 1");
    if(!isset($_POST['prov']) || trim($_POST['prov'])=="" || strpos($_POST['prov'],"resetpsw.php")!==false || strpos($_POST['prov'],"login.php")!==false || strpos($_POST['prov'],"registrazione.php")!==false){
    $locain="index.php";
    }else{
    $locain=$_POST['prov'];
    }
    } else {
    header("Location: index.php?ko=1");
    exit;
    }
    header("Location: $locain");
    exit;
    }else{
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo13">
    ".errore.": ".err_user_psw."!<br />
    ".cookie_abilitati.".</div></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="login.php" method="post" name="login" id="login">
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo11">".username.":</div></td>
    <td width="65%" class="tabstat"><input name="username" type="text" id="username" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo11">".psw.":</div></td>
    <td class="tabstat"><input name="passw" type="password" id="passw" size="45" /></td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input type="hidden" name="actlog" value="entra" />
    <input type="hidden" name="prov" value="".$_SERVER['HTTP_REFERER']."" />
    <input type="submit" name="Submit2" value=" ".entra." " class="pulsinvia" />
    </div></td>
    </tr>
    </form>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <td colspan="2" class="tabstat"><div align="center">
    <p class="testo11"><a href="resetpsw.php">".psw_persa."</a></p>
    </div></td>
    </tr>
    </table><br />";
    }
    }

    }else if($actlog=="out"){

    //$rootcookie=$_SERVER['HTTP_HOST'];
    //$rootcookie=str_replace("www.","",$rootcookie);
    setcookie("denome","",time()-(86400365),"/");
    setcookie("depsw","",time()-(86400
    365),"/");
    quera("DELETE FROM ".$tblprefix."online WHERE userid='".my_id."' LIMIT 1");
    $upd = quera("UPDATE ".$tblprefix."users SET lasttime = '0' WHERE nome='".$_COOKIE['denome']."' AND psw='".$_COOKIE['depsw']."' LIMIT 1");
    header("Location: index.php");
    exit;
    }else{

    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="login.php" method="post" name="login" id="login">
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo11">".username.":</div></td>
    <td width="65%" class="tabstat"><input name="username" type="text" id="username" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo11">".password.":</div></td>
    <td class="tabstat"><input name="passw" type="password" id="passw" size="45" /></td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="actlog" type="hidden" id="actlog" value="entra" />
    <input type="hidden" name="prov" value="".$_SERVER['HTTP_REFERER']."" />
    <input type="submit" name="Submit2" value=" ".entra." " class="pulsinvia" />
    </div></td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center">
    <p class="testo11"><a href="resetpsw.php">".psw_persa."</a></p>
    </div></td>
    </tr>
    </form>
    </table>
    <br />
    <form action="registrazione.php">
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="tabstat"><div align="center" class="testo11">".non_registrato."?</div>
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="center" class="testo12">
    <input type="submit" name="Submit" value="".registrati."" class="pulsinvia" />
    </div>
    </td>
    </tr>
    </table>
    </form>";
    }
    if($_GET['debug']=="y"){ debugging(); }
    require_once "copy.php";
    ?>
    adesso sloggati e riloggati e dovrebbe funzionare tutto
    [/php]

    per le email dovresti speigare meglio cosa arriva, possibilmente incollandoci qui l'email che arriva. E postandoci il file con le costanti e il file register.php


  • User Attivo

    allora questa è la mail che arriva:

    w.w.w.globalmeteo.altervista.org/mailllchearriva.txt

    questa è la pagina registrazione:

    w.w.w.globalmeteo.altervista.org/registrazione.txt


  • ModSenior

    il primo link non funziona...


  • User Attivo

  • ModSenior

    perchè non manda l'email in formato html, ma avrebbe dovuto farlo pure la prima volta... comunque postami il file funzioni.php che modifichiamo 😉


  • User Attivo

  • ModSenior

    Funzioni.php
    [php]
    <?php
    #- Invio e-mail -#
    function checkmail($m){
    $r1="([a-z0-9]+[";
    $r2="-]?){1,3}([a-z0-9])*";
    return preg_match("/(?i)^{$r1}._{$r2}@{$r1}.{$r2}.[a-z]{2,6}$/",$m);
    }

    function mandamail($mail_dest,$mail_oggetto,$mail_testo){
    if($mail_dest!=""){
    global $arr_impostazioni;
    $headers_mail="From: ".$arr_impostazioni['titoloforum']." <".$arr_impostazioni['mailsito'].">\r\n".stripcslashes($arr_impostazioni['header_email'])."\r\n";
    mail($mail_dest,$mail_oggetto,$mail_testo,$headers_mail);
    }
    }

    function mandamailhtml($mail_dest,$mail_oggetto,$mail_testo){
    if($mail_dest!=""){
    global $arr_impostazioni;
    $headers_mail="From: ".$arr_impostazioni['titoloforum']." <".$arr_impostazioni['mailsito'].">\r\n".stripcslashes($arr_impostazioni['header_email'])."\r\nContent-Type: text/html; charset=ISO-8859-1\r\n";
    mail($mail_dest,$mail_oggetto,$mail_testo,$headers_mail);
    }
    }

    function mandamassmail($bcc_mail_dest,$m_mail_oggetto,$m_mail_testo){
    if($bcc_mail_dest!=""){
    global $arr_impostazioni;
    $headers_mail="From: ".$arr_impostazioni['titoloforum']." <".$arr_impostazioni['mailsito'].">\r\n".stripcslashes($arr_impostazioni['header_email'])."\r\n";
    mail($arr_impostazioni['mailsito'],$m_mail_oggetto,$m_mail_testo,$headers_mail);
    }
    }

    #- Stampa errore -#
    function errore_generale($link1,$link2,$messaggio,$indietro,$login=false){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr class="tabcat">
    <td class="testo11"><strong><a href="index.php">Home</a>";
    if($link1!=""){
    echo " » $link1";
    if($link2!=""){
    echo " » $link2";
    }
    }
    echo "</strong></td>
    </tr>
    </table>
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="6" class="testo12">".errore.": $messaggio.";
    if($indietro){
    echo "<br /><br />
    <a href="#" onclick="javascript:history.go(-1);"><b>".indietro."</b></a>";
    }
    echo "</td>
    </tr>
    </table>";
    if($login){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr class="tabcat">
    <td><a href="login.php"><b>".click_per_login.".</b></a></td>
    </tr>
    </table>";
    }
    }

    #- Stampa form per topic, post, pvt, ...
    function stampa_form($tipo,$link1,$link2,$bloccoanteprima,$errore,$action,$set_oggetto=false,$oggetto='',$testoarea,$allegato=false,$notifica=false,$hidden,$btn_anteprima='',$btn_invia){
    global $arr_impostazioni;
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr class="tabcat">
    <td class="testo11"><strong><a href="index.php">Home</a>";
    if($link1!=""){
    echo " » $link1";
    if($link2!=""){
    echo " » $link2";
    }
    }
    echo "</strong></td>
    </tr>
    </table>
    $bloccoanteprima
    <form name="scrivo" action="$action" method="post" enctype="multipart/form-data">
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    $errore";
    if($set_oggetto){
    echo "<tr>
    <td class="tabstat"><div align="right" class="testo11">".oggetto.":</div></td>
    <td class="tabstat"><input name="oggetto" type="text" id="oggetto" size="70" tabindex="1" value="$oggetto" /></td>
    </tr>";
    }
    require_once "btn_tag.php";
    switch($tipo){
    case 0: $nome_textarea=testo; break;
    case 1: $nome_textarea=risposta; break;
    case 2: $nome_textarea=messaggio; break;
    }
    echo "<tr>
    <td width="22%" valign="top" class="tabstat" align="right"><span class="testo11">$nome_textarea:
    </span></td>
    <td width="78%" valign="top" class="tabstat"><textarea name="testo" rows="13" cols="60" tabindex="2">$testoarea</textarea></td>
    </tr>
    <tr>";
    require_once "emo.php";
    if($arr_impostazioni['setallegati']=="1" && $allegato){
    echo "</tr>
    <tr>
    <td colspan="2" class="tabstat" align="center"><span class="testo12">".carica_allegato.": <input name="inallegato" type="file" size="25" /> <a href="#" onClick="window.open('guidaallegafile.php','guidaallegafile','width=420,height=180,resizable=yes'); return false;"><img src="img/interroga.gif" border="0" alt="".help."" title="".help.""></a>
    </td>";
    }
    if(user_esistente=="si" && $notifica){
    if(my_default_notifica=="1"){ $noti_check=" checked="checked""; }else{ $noti_check=""; }
    echo "</tr>
    <tr>
    <td colspan="2" class="tabstat" align="center"><span class="testo11">
    <input type="checkbox" name="notifica" value="notifica"$noti_check /> ".check_notifica."</span></td>";
    }
    echo "</tr>
    <tr>
    <td colspan="2" class="tabstat" align="center" class="testo12">";
    foreach($hidden as $h_nome=>$h_valore){
    echo "<input type="hidden" name="$h_nome" value="$h_valore" />\n";
    }
    echo "<input type="button" name="annullaform" value=" ".annulla_form." " class="pulsanti" onclick="javascript:history.go(-1);" />\n";
    if($btn_anteprima!=""){
    echo "<input type="submit" name="anteprimaform" value="".anteprima_form."" class="pulsanti" onclick="$btn_anteprima" />\n";
    }
    echo "<input type="submit" name="inviaform" accesskey="s" value=" ".invia_form." " class="pulsinvia" onclick="$btn_invia" />
    </td>
    </tr>
    </table>
    </form>";
    }

    #- Stampa colonna autore per, topic, post, msgpvt, profilo, ...
    function colonna_autore($anonimo=false,$arr_info){
    /* Array: 'nome'=>"",'userid'=>"",'ip'=>"",'avatar'=>"",'luogo'=>"",'sito'=>"",'msn'=>"",'icq'=>"",'aim'=>"",'yahoo'=>"",'skype'=>"",'firma'=>"",'bannato'=>"",'livello'=>"",'nposts'=>"",'datareg'=>"" /
    if($anonimo){
    $colonna_autore="<td valign="top" class="tabstat" width="170"><div align="center" class="testo13"><strong>".anonimo."</strong><br /><br />";
    if((my_level=="1" || my_level=="2") && isset($arr_info['ip'])){
    $colonna_autore.="<img src="img/ip.gif" border="0" alt="".$arr_info['ip']."" title="".$arr_info['ip']."" width="10" height="12" />";
    }
    }else{
    if($arr_info['luogo']!=""){ $arr_info['luogo']=user_luogo.": ".$arr_info['luogo']."<br />"; }
    if($arr_info['sito']!=""){ $arr_info['sito']=str_replace("http://","",$arr_info['sito']); $arr_info['sito']="<a href="http://".$arr_info['sito']."" target="blank"><img src="img/home.gif" border="0" alt="".$arr_info['sito']."" title="".$arr_info['sito']."" /></a>"; }
    if($arr_info['msn']!=""){ $arr_info['msn']="<img src="img/msn.gif" border="0" alt="".$arr_info['msn']."" title="".$arr_info['']."" />"; }
    if($arr_info['icq']!=""){ $arr_info['icq']="<img src="img/icq.gif" border="0" alt="".$arr_info['icq']."" title="".$arr_info['icq']."" />"; }
    if($arr_info['aim']!=""){ $arr_info['aim']="<img src="img/aim.gif" border="0" alt="".$arr_info['aim']."" title="".$arr_info['aim']."" />"; }
    if($arr_info['yahoo']!=""){ $arr_info['yahoo']="<img src="img/yahoo.gif" border="0" alt="".$arr_info['yahoo']."" title="".$arr_info['yahoo']."" />"; }
    if($arr_info['skype']!=""){ $arr_info['skype']="<img src="img/skype.gif" border="0" alt="".$arr_info['skype']."" title="".$arr_info['skype']."" />"; }
    if($arr_info['firma']!=""){ $arr_info['firma']="
    ___________________________________<br />\n".formatta_testo_post($arr_info['firma']); }
    if($arr_info['bannato']=="1"){
    $arr_info['livello']="<i>".user_bannato."</i><br />";
    }else{
    if($arr_info['livello']=="0"){
    if($arr_impostazioni['setlivelli']==1 && is_array($arr_nomi_livelli) && count($arr_nomi_livelli)>=1){
    reset($arr_nomi_livelli);
    foreach($arr_nomi_livelli as $l_k=>$l_titolo){
    if($l_titolo!=""){
    if($arr_info['nposts']>=$arr_nposts_livelli[$l_k]){
    if($arr_img_livelli[$l_k]=="" || !file_exists("img/".$arr_img_livelli[$l_k])){
    $arr_info['livello']=$l_titolo."<br />";
    }else{
    $arr_dim=getimagesize("img/".$arr_img_livelli[$l_k]);
    $arr_info['livello']="$l_titolo<br /><img src="img/".$arr_img_livelli[$l_k]."" width="".$arr_dim[0]."" height="".$arr_dim[1]."" alt="$l_titolo" /><br />";
    }
    }
    }
    }
    }else{ $arr_info['livello']=""; }
    }else if($arr_info['livello']=="1"){ $arr_info['livello']=user_mod."<br />"; } else if($arr_info['livello']=="2"){ $arr_info['livello']=user_admin."<br />"; }
    }
    if($arr_info['avatar']!=""){
    $arr_info['avatar']="<br /><a href="users.php?id=".$arr_info['userid'].""><img src="avatar/".$arr_info['avatar']."" alt="".user_profilo."" title="".user_profilo."" border="0" /></a>";
    }
    $stato = ($arr_info['lasttime'] > (time()-60
    15)) ? 'Connesso' : 'Disconnesso';
    $colonna_autore="<td valign="top" class="tabstat" width="170" align="center"><span class="testo13"><strong><a href="users.php?id=".$arr_info['userid']."">".$arr_info['nome']."</a></strong></span>
    ".$arr_info['avatar']."<br />
    <span class="testo10">".$arr_info['livello']."<br /></span>
    <div align="left" class="testo10">".user_num_messaggi.": ".$arr_info['nposts']."<br />
    ".user_datareg." ".$arr_info['datareg']."<br />
    Stato: ".$stato."<br />
    ".$arr_info['luogo']."<br /></div>
    ".$arr_info['home']." ".$arr_info['msn']." ".$arr_info['icq']." ".$arr_info['aim']." ".$arr_info['yahoo']." ".$arr_info['skype']."<br />";
    if((my_level=="1" || my_level=="2") && isset($arr_info['ip'])){
    $colonna_autore.="<img src="img/ip.gif" border="0" alt="".$arr_info['ip']."" title="".$arr_info['ip']."" width="10" height="12" />";
    }
    if(user_esistente=="si" && my_bannato!="si"){
    $colonna_autore.="<a href="msgpvt.php?act=new&userid=".$arr_info['userid'].""><img src="img/mp.gif" width="15" height="12" border="0" alt="".invia_mp."" title="".invia_mp.""></a>";
    }
    }
    return "$colonna_autore</div></td>";
    }

    #- Query e gestione degli errori del db -#
    function db_errore($mysqlerror,$mysqlerrno,$query_fatta){
    if($mysqlerrno=="1062"){
    return "<b>Errore del database MySql:</b> valore duplicato";
    }else{
    echo "<b>Errore del database MySql:</b> <tt>$mysqlerror</tt><br /><br />\n
    <b>Query:</b> <tt>$query_fatta</tt><br />\n";
    }
    }

    function quera($stringa_query){
    global $contaquery;
    if(!$risultato_query=mysql_query($stringa_query)){
    db_errore(mysql_error(),mysql_errno(),$stringa_query);
    }
    if(isset($contaquery)){
    $contaquery+=1;
    }else{
    $contaquery=1;
    }
    return $risultato_query;
    }

    function select_salta_stanza($stanza_attuale,$Today_topics){
    global $tblprefix;
    if(my_level=="1" || my_level=="2"){ $pezzo_query=""; }else{ $pezzo_query="WHERE s.privato='0' AND c.privato='0'"; }
    $q_linkstanze=quera("SELECT s.id,s.nome FROM ".$tblprefix."stanze AS s LEFT JOIN ".$tblprefix."categorie AS c ON s.cat=c.id $pezzo_query ORDER BY s.cat,s.ordine");
    while($arr_linkstanze=mysql_fetch_assoc($q_linkstanze)){
    if($arr_linkstanze['id']==$stanza_attuale){ $stanza_selected=" selected="selected""; }else{ $stanza_selected=""; }
    $gruppolinkstanze.="<option value="".$arr_linkstanze['id'].""$stanza_selected>".$arr_linkstanze['nome']."</option>\n";
    }
    if($stanza_attuale=="today"){ $stanza_selected=" selected="selected""; }else{ $stanza_selected=""; }
    $gruppolinkstanze.="<option value="today" style="background-color:#EBEBEB;"$stanza_selected>$Today_topics</option>\n";
    return $gruppolinkstanze;
    }

    function return_data($UnixTime,$anche_ora,$anche_secondi,$Oggi_Ieri=true){
    if(!$Oggi_Ieri){
    if($anche_ora){
    $data_finale=date("d/m/Y H:i",$UnixTime);
    }else{
    $data_finale=date("d/m/Y",$UnixTime);
    }
    }else{
    if($anche_ora){
    if(date("d/m/Y")==date("d/m/Y",$UnixTime)){
    $data_finale="Oggi ".date("H:i",$UnixTime);
    }else if(date("d/m/Y",mktime(0,0,0,date("m"),date("d")-1,date("Y")))==date("d/m/Y",$UnixTime)){
    $data_finale="Ieri ".date("H:i",$UnixTime);
    }else{
    $data_finale=date("d/m/Y H:i",$UnixTime);
    }
    if($anche_secondi){
    $data_finale.=":".date("s",$UnixTime);
    }
    }else{
    if(date("d/m/Y")==date("d/m/Y",$UnixTime)){
    $data_finale="Oggi";
    }else if(date("d/m/Y",mktime(0,0,0,date("m"),date("d")-1,date("Y")))==date("d/m/Y",$UnixTime)){
    $data_finale="Ieri";
    }else{
    $data_finale=date("d/m/Y",$UnixTime);
    }
    }
    }
    return $data_finale;
    }

    function select_giorni($sel){
    if(is_null($sel)){
    for($g_i=1;$g_i<=31;$g_i++){
    $stringa_elenco_giorni.="<option value="$g_i">$g_i</option>\n";
    }
    }else{
    for($g_i=1;$g_i<=31;$g_i++){
    if($g_i==$sel){ $selected=" selected="selected""; }else{ $selected=""; }
    $stringa_elenco_giorni.="<option value="$g_i"$selected>$g_i</option>\n";
    }
    }
    return "<option></option>\n".$stringa_elenco_giorni;
    }

    function select_mesi($sel){
    $nomi_mesi=array("gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre");
    if(is_null($sel)){
    foreach($nomi_mesi as $m_k=>$m_v){
    $stringa_elenco_mesi.="<option value="".($m_k+1)."">".ucfirst($m_v)."</option>\n";
    }
    }else{
    $sel-=1;
    foreach($nomi_mesi as $m_k=>$m_v){
    if($m_k==$sel){ $selected=" selected="selected""; }else{ $selected=""; }
    $stringa_elenco_mesi.="<option value="".($m_k+1).""$selected>".ucfirst($m_v)."</option>\n";
    }
    }
    return "<option></option>\n".$stringa_elenco_mesi;
    }

    function select_anni($sel){
    if(is_null($sel)){
    for($a_i=2005;$a_i>1920;$a_i--){
    $stringa_elenco_anni.="<option value="$a_i">$a_i</option>\n";
    }
    }else{
    for($a_i=2005;$a_i>1920;$a_i--){
    if($a_i==$sel){ $selected=" selected="selected""; }else{ $selected=""; }
    $stringa_elenco_anni.="<option value="$a_i"$selected>$a_i</option>\n";
    }
    }
    return "<option></option>\n".$stringa_elenco_anni;
    }

    function getmicrotime(){
    list($usec,$sec)=explode(" ",microtime());
    return((float)$usec+(float)$sec);
    }

    function debugging(){
    global $contaquery;
    echo "<div align="center" class="testo10">Versione deForum: ".versione_deForum." (".versione_code.") | Numero di queries: $contaquery | Versione PHP: ".PHP_VERSION." | Versione MySql: ".mysql_get_server_info()."</div>";
    }
    ?>
    [/php]


  • ModSenior

    registrati.php
    [php]
    <?php
    require_once "includes/config.php";
    require_once "includes/mysql_connect.php";
    require_once "includes/getsett.php";
    require_once "includes/funzioni.php";
    require_once "includes/funzioni_testi.php";
    if(trim($arr_impostazioni['lingua'])=="" || !is_dir("lang/".$arr_impostazioni['lingua'])){ $arr_impostazioni['lingua']="ita"; }
    require_once "lang/".$arr_impostazioni['lingua']."/registrazione.php";
    if(user_esistente=="si"){
    if(my_bannato=="si"){
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="testo12">".sei_bannato.".<br /><br />
    <a href="mailto:".$arr_impostazioni['mailsito']."">".contatta_admin.".</td>
    </tr>
    </table>";
    }else{
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="testo12">".err_loggato.".</td>
    </tr>
    </table>";
    }
    }else{
    $step=(ereg("[1-4]",$_GET['step'])) ? (int)$_GET['step'] : (int)$_POST['step'];
    if($step==2){ //STEP 2 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo1);
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if($step==3){ //STEP 3 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo2);
    $_POST['newmail']=togli_char_spec($_POST['newmail']);
    $_POST['newuser']=togli_char_spec($_POST['newuser']);
    require_once "header.php";
    if(!checkmail($_POST['newmail'])){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_mail."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else{
    $q_useresiste=quera("SELECT nome,mail FROM ".$tblprefix."users WHERE nome='".mysql_escape_string($_POST['newuser'])."' OR mail='".mysql_escape_string($_POST['newmail'])."' LIMIT 1");
    if(mysql_num_rows($q_useresiste)>0){
    $arr_useresistente=mysql_fetch_assoc($q_useresiste);
    if($_POST['newuser']==$arr_useresistente['nome']){ $stringa_esiste.="• username<br />"; }
    if($_POST['newmail']==$arr_useresistente['mail']){ $stringa_esiste.="• e-mail<br />"; }
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_dati_usati.":<br />
    $stringa_esiste</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(!isset($_POST['newuser']) || trim($_POST['newuser'])=="" || !isset($_POST['newpsw']) || trim($_POST['newpsw'])==""){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_campi."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(trim($_POST['newpsw'])!=trim($_POST['newcpsw'])){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_psw."!</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else if(strlen(trim($_POST['newuser']))>20 || strlen(trim($_POST['newmail']))>40 || strlen(trim($_POST['newpsw']))>20){
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".errore."</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">".err_lunghezza.".</span></td>
    </tr>
    </table><br />
    <table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".inserisci_dati.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".username.":</span></div></td>
    <td width="65%" class="tabstat"><input name="newuser" type="text" id="newuser" size="45" maxlength="20" value="".$_POST['newuser']."" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".password.":</div>
    </td>
    <td class="tabstat"><input name="newpsw" type="password" id="newpsw" size="45" maxlength="20" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".cpassword.":</div></td>
    <td class="tabstat"><input name="newcpsw" type="password" id="newcpsw" size="45" maxlength="20" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".email.":</div>
    </td>
    <td class="tabstat"><input name="newmail" type="text" id="newmail" size="45" maxlength="40" value="".$_POST['newmail']."" />
    </td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="3" />
    <input name="prosegui" type="button" class="pulsinvia" value="".avanti_form."" onClick="convalida();" />
    </div></td>
    </tr>
    </form>
    </table>";
    }else{
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <form action="registrazione.php" method="post" enctype="multipart/form-data" name="registra">
    <tr>
    <td colspan="2" class="tabstat"><div class="testo12"><strong>".profilo.":</strong></div></td>
    </tr>
    <tr>
    <td width="35%" class="tabstat"><div align="right" class="testo12"><span class="testo12">".luogo.":</span></div></td>
    <td width="65%" class="tabstat"><input name="luogo" type="text" id="luogo" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".homepage.":</div>
    </td>
    <td class="tabstat"><input name="sito" type="text" id="sito" size="45" />
    </td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">MSN:</div></td>
    <td class="tabstat"><input name="msn" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">ICQ:</div></td>
    <td class="tabstat"><input name="icq" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">AIM:</div></td>
    <td class="tabstat"><input name="aim" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">Yahoo:</div></td>
    <td class="tabstat"><input name="yahoo" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right">Skype:</div></td>
    <td class="tabstat"><input name="skype" type="text" size="45" /></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="right" class="testo12">".nascita.":</div></td>
    <td class="tabstat"><span class="testo11">".giorno.":
    <select name="nascitagiorno"> ".select_giorni('')."</select>
    ".mese.": <select name="nascitamese">".select_mesi('')."</select>
    ".anno.":
    <select name="nascitaanno"> ".select_anni('')."</select></span></td>
    </tr>
    <tr>
    <td valign="top" class="tabstat"><div align="right" class="testo12">".firma.":<br /><span class="testo10">(".firma_max.": ".$arr_impostazioni['maxfirma'].")</span></div></td>
    <td class="tabstat"><textarea name="firma" cols="40" rows="5" id="firma" onKeyDown="if(this.value.length>".$arr_impostazioni['maxfirma'].")this.value=this.value.substr(0,".$arr_impostazioni['maxfirma'].")"></textarea></td>
    </tr>
    <tr>
    <td colspan="2" class="tabstat"><div align="center" class="testo12">
    <input name="step" type="hidden" id="step" value="4" />
    <input name="newuser" type="hidden" value="".$_POST['newuser']."" />
    <input name="newpsw" type="hidden" value="".$_POST['newpsw']."" />
    <input name="newmail" type="hidden" value="".$_POST['newmail']."" />
    <input type="submit" class="pulsinvia" value="".prosegui_form."" />
    </div></td>
    </tr>
    </form>
    </table>";
    }
    }
    }else if($step==4){ //STEP 4 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo3);
    $_POST['newmail']=togli_char_spec($_POST['newmail']);
    $_POST['newuser']=togli_char_spec($_POST['newuser']);
    $_POST['firma']=togli_char_spec($_POST['firma']);
    $_POST['luogo']=togli_char_spec($_POST['luogo']);
    $_POST['sito']=togli_char_spec($_POST['sito']);
    $_POST['msn']=togli_char_spec($_POST['msn']);
    $_POST['icq']=togli_char_spec($_POST['icq']);
    $_POST['aim']=togli_char_spec($_POST['aim']);
    $_POST['yahoo']=togli_char_spec($_POST['yahoo']);
    $_POST['skype']=togli_char_spec($_POST['skype']);

    if(trim($_POST['firma'])!=""){
    $firma=mysql_escape_string($_POST['firma']);
    }
    $codice = md5(microtime());
    quera("INSERT INTO ".$tblprefix."users (nome,psw,ip,mail,attivazione,firma,datareg,nascita_g,nascita_m,nascita_a,luogo,sito,msn,icq,aim,yahoo,skype)
    VALUES ('".mysql_escape_string($_POST['newuser'])."','".md5($_POST['newpsw'])."','".$_SERVER['REMOTE_ADDR']."','".mysql_escape_string($_POST['newmail'])."','$codice','$firma','".time()."','".$_POST['nascitagiorno']."','".$_POST['nascitamese']."','".$_POST['nascitaanno']."','".mysql_escape_string($_POST['luogo'])."','".mysql_escape_string($_POST['sito'])."','".mysql_escape_string($_POST['msn'])."','".mysql_escape_string($_POST['icq'])."','".mysql_escape_string($_POST['aim'])."','".mysql_escape_string($_POST['yahoo'])."','".mysql_escape_string($_POST['skype'])."')");
    quera("UPDATE ".$tblprefix."stats SET tot_users=tot_users+1, ultimo_userid='".mysql_insert_id()."'");
    $link = 'http://'.$_SERVER['SERVER_NAME'].'/forum/attiva.php?act='.$codice;
    $corpo=mail_benvenuto." ".$_POST['newuser'].",\n\n".'Per attivare il tuo account devi visitare il seguente link: <a href="'.$link.'">'.$link.'</a>'.mail_reg_completata."!\n\n
    ".mail_staff."! :)\n\n\n".$arr_impostazioni['urlforum'];
    mandamailhtml($_POST['newmail'],$arr_impostazioni['titoloforum']." - ".mail_oggetto."!",$corpo);
    define('in_reg_step4','si');
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td width="100%" class="tabstat"><span class="testo12">".mail_benvenuto." <strong>".$_POST['newuser']."</strong>, ".mail_reg_completata."!<br />
    <br />
    ".ora_puoi.".<br />
    ".puoi_modificare.".</span> <img src="img/empty.gif" border="0" onload="concalma('index.php','4000');" /></td>
    </tr>
    </table>";
    }else{ //STEP 1 ---------------------------------------------------------------------
    define('titolo_pagina',' - '.registrazione_titolo4);
    require_once "header.php";
    echo "<table width="880" border="0" align="center" cellpadding="5" cellspacing="1" class="tabcat">
    <tr>
    <td class="tabstat"><div class="testo12"><strong>".regolamento.":</strong></div></td>
    </tr>
    <tr>
    <td class="tabstat"><span class="testo12">1) ".regola1.".<br /><br />
    2) ".regola2.".<br /><br />
    3) ".regola3.".<br /><br />
    4) ".regola4.".<br /><br />
    5) ".regola5.".<br /><br />
    6) ".regola6.".<br /><br />
    7) ".regola7.".</span></td>
    </tr>
    <tr>
    <td class="tabstat"><div align="center" class="testo12">
    <input name="prosegui" type="button" class="pulsinvia" onClick="window.location='registrazione.php?step=2'" value=" ".accetto_form." " />
    </div></td>
    </tr>
    </table>";
    }
    }
    if($_GET['debug']=="y"){ debugging(); }
    require_once "copy.php";
    ?>
    [/php]
    ora dovrebbe funzionare normalmente... 😉


  • User Attivo

    si funziona tutto normalmente tranne che adesso mi rimette sempre disconnesso


  • ModSenior

    come fa a darti sempre disconnesso... che non abbiamo modificato nulla.. e prima funzionava... O.o


  • User Attivo

    @Thedarkita said:

    come fa a darti sempre disconnesso... che non abbiamo modificato nulla.. e prima funzionava... O.o

    niente va credo si sia formato un errore sul database, mi conviene cancellare tutto e ripetere l'installazione


  • User Attivo

    bho ho rifatto tutto daccapo ma non ne vuole sapere ho fatto un bordello con i file forse bisognerebbe raggruppare tutti i file esatti così da sapere quali sono quelli ok


  • ModSenior

    o mio dio... XD ma perchè hai cambiato i file se tutto funzionava? XD


  • User Attivo

    @Thedarkita said:

    o mio dio... XD ma perchè hai cambiato i file se tutto funzionava? XD

    scusa tanto, ho fatto confusione ma adesso è tutto quanto a posto, ancora grazie!!!!! :ciauz:😉


  • ModSenior

    @giulio3x said:

    scusa tanto, ho fatto confusione ma adesso è tutto quanto a posto, ancora grazie!!!!! :ciauz:😉

    non ti dico quanto sono felice... 😄

    😉

    fatti un backup dei file che è meglio 😉