GoddinoUD2
Utente Electrum
Salve community
come da titolo sono alla ricerca di una pagina di registrazione per il mio server
ho uno script per la pagina di registrazione
ma ogni dato che metto
anche se accedendo con navicat vedo che l'account non esiste
mi dice
"questo id esiste già"
è un semplice script di connessione al database con inserimento dati..
vi posto lo script
come da titolo sono alla ricerca di una pagina di registrazione per il mio server
ho uno script per la pagina di registrazione
ma ogni dato che metto
anche se accedendo con navicat vedo che l'account non esiste
mi dice
"questo id esiste già"
è un semplice script di connessione al database con inserimento dati..
vi posto lo script
<html>
<head>
<link rel="shortcut icon" href="/images/favicon.png">
<title>CompanyLOTS - Registrazione</title>
</head>
<body style="background: [HASHTAG]#000000[/HASHTAG] url('background.jpg') 50% 0 no-repeat;">
<?php
###### Database Log Account #####
// codice della tabella
# create table `Account_log_NewAge` ( `id` int UNSIGNED NOT NULL AUTO_INCREMENT , `nome` varchar (10) NOT NULL , `password` varchar (10) NOT NULL , `ip` varchar (18) NOT NULL , `nazione` varchar (15) NOT NULL , PRIMARY KEY (`id`))
function StatoIp($ipAddr)
{
ip2long($ipAddr)== -1 || ip2long($ipAddr) === false ? trigger_error("Invalid IP", E_USER_ERROR) : "";
$ipDetail=array();
$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='IP DEL MIO SERVER DEDICATO';
$Login_db='root';
$pwd_db='PASSWORD DEL MIO DATABASE';
$bdd_name='account';
/* end of Configuration */
/**********Bonus********/
$create_time=date('Y-m-d H:i:s');
$cash='999999';
$gold_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$silver_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$safebox_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$autoloot_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$fish_mind_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$marriage_fast_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$money_drop_rate_expire=(date("Y")+100)."-".date("m")."-".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("L'account $Login è stato creato con successo!");
$ip=$_SERVER['REMOTE_ADDR'];
$Stato=StatoIp($ip);
if ($Stato['country']=="ITALY" || $Stato['country']=="EUROPEAN UNION" || $Stato['country']=="unknown" ){
echo("L'account $Login è stato creato con successo!");
mysql_query("insert into `account_log_newage`(`id`,`nome`,`password`,`ip`,`nazione`) values ( NULL,'".$Login."','".$password."','".$ip."',' ".$Stato['country']."')");
}else{
echo "Benvenuto su CompanyLOTS";
}
}else{
echo"Questo ID Esiste gia'";
}
}else{
echo "Password Errata";
}
}else{
echo " <FORM action='account_create.php' method='post'>
<center><table border='0' width='95%' align='center'>
<tr>
<td>Id :Massimo 9 caratteri</td><td>
<input tabindex='1' name='Login' class='application' size='30' /></td>
</tr>
<tr>
<td>Password :Massimo 9 Caratteri</td><td>
<input tabindex='2' name='password' type='password' class='application' size='30' /></td>
</tr>
<tr>
<td>Ripeti password :</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>Password per cancellare PG :massimo 7 NUMERI</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'>Registrati</button></td></center>
</FORM>";
}
?>
</body>
</html>
<head>
<link rel="shortcut icon" href="/images/favicon.png">
<title>CompanyLOTS - Registrazione</title>
</head>
<body style="background: [HASHTAG]#000000[/HASHTAG] url('background.jpg') 50% 0 no-repeat;">
<?php
###### Database Log Account #####
// codice della tabella
# create table `Account_log_NewAge` ( `id` int UNSIGNED NOT NULL AUTO_INCREMENT , `nome` varchar (10) NOT NULL , `password` varchar (10) NOT NULL , `ip` varchar (18) NOT NULL , `nazione` varchar (15) NOT NULL , PRIMARY KEY (`id`))
function StatoIp($ipAddr)
{
ip2long($ipAddr)== -1 || ip2long($ipAddr) === false ? trigger_error("Invalid IP", E_USER_ERROR) : "";
$ipDetail=array();
$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='IP DEL MIO SERVER DEDICATO';
$Login_db='root';
$pwd_db='PASSWORD DEL MIO DATABASE';
$bdd_name='account';
/* end of Configuration */
/**********Bonus********/
$create_time=date('Y-m-d H:i:s');
$cash='999999';
$gold_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$silver_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$safebox_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$autoloot_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$fish_mind_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$marriage_fast_expire=(date("Y")+100)."-".date("m")."-".date("d")." ".date("H").":".date("i").":".date("s");
$money_drop_rate_expire=(date("Y")+100)."-".date("m")."-".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("L'account $Login è stato creato con successo!");
$ip=$_SERVER['REMOTE_ADDR'];
$Stato=StatoIp($ip);
if ($Stato['country']=="ITALY" || $Stato['country']=="EUROPEAN UNION" || $Stato['country']=="unknown" ){
echo("L'account $Login è stato creato con successo!");
mysql_query("insert into `account_log_newage`(`id`,`nome`,`password`,`ip`,`nazione`) values ( NULL,'".$Login."','".$password."','".$ip."',' ".$Stato['country']."')");
}else{
echo "Benvenuto su CompanyLOTS";
}
}else{
echo"Questo ID Esiste gia'";
}
}else{
echo "Password Errata";
}
}else{
echo " <FORM action='account_create.php' method='post'>
<center><table border='0' width='95%' align='center'>
<tr>
<td>Id :Massimo 9 caratteri</td><td>
<input tabindex='1' name='Login' class='application' size='30' /></td>
</tr>
<tr>
<td>Password :Massimo 9 Caratteri</td><td>
<input tabindex='2' name='password' type='password' class='application' size='30' /></td>
</tr>
<tr>
<td>Ripeti password :</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>Password per cancellare PG :massimo 7 NUMERI</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'>Registrati</button></td></center>
</FORM>";
}
?>
</body>
</html>

