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> </td><td> </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> Parola a fost schimbată cu succes.<br/><br/></h1><div class="trenner"></div>';
}
else {
echo'<h1> Schimbarea parolei a eşuat.<br/><br/></h1><div class="trenner"></div>';
}
}
else {
echo'<h1> Parola care aţi introduso a fost incorectă.<br/><br/></h1><div class="trenner"></div>';
}
}
else {
echo'<h1> 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> </td><td> </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> Parola a fost schimbată cu succes.<br/><br/></h1><div class="trenner"></div>';
}
else {
echo'<h1> Schimbarea parolei a eşuat.<br/><br/></h1><div class="trenner"></div>';
}
}
else {
echo'<h1> Parola care aţi introduso a fost incorectă.<br/><br/></h1><div class="trenner"></div>';
}
}
else {
echo'<h1> 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>