I wrote this php code(under the message) and its only working in windows i tried everyway but i couldnt work it in linux it always gives this error "Please fill all the blanks and be sure that your password has more than 5 character"
if i delete the password length lines this time it gives "please enter a valid email adress" error
Where did i make mistake?
<?
@mysql_connect("localhost", "dakkar", "1234567")
or die("Veritabani ile baglanti kurulamadi!");
@mysql_select_db("account")
or die("Veritabaninda bir hata olustu!");
$sql = "SELECT count(*) FROM accounts WHERE username = '".$_GET['u_name']."'";
$res = mysql_query($sql) OR die(mysql_error());
$row = mysql_fetch_row($res);
$sub1 = substr_count("$pass", "0");
$sub2 = substr_count("$pass", "1");
$sub3 = substr_count("$pass", "2");
$sub4 = substr_count("$pass", "3");
$sub5 = substr_count("$pass", "4");
$sub6 = substr_count("$pass", "5");
$sub7 = substr_count("$pass", "6");
$sub8 = substr_count("$pass", "7");
$sub9 = substr_count("$pass", "8");
$sub10 = substr_count("$pass", "9");
if($row[0] == 0) {
if (($u_name !== "") && ($pass !== "") && ($mail !== "") && ($anne != "") && ($name !== "") && (strlen($pass)>5)) {
if (($sub1 < 2) && ($sub2 < 2) && ($sub3 < 2) && ($sub4 < 2) && ($sub5 < 2) && ($sub6 < 2) && ($sub7 < 2) && ($sub8 < 2) && ($sub9 < 2) && ($sub10 < 2)) {
if (ereg("@",$mail) && ereg(".",$mail)) {
if (eregi("remote",$u_name) || eregi("admin",$u_name) || eregi("telnet",$u_name)) {
echo "<center><b>It is a forbidden nick.</b></center>";
} else {
@mysql_query("insert into accounts values('','$u_name','$pass','$name','$anne','Adres','Telefon','$mail','sg','sa','sy','bg','ba','bay','0')");
echo "<center><b>Your data has inserted into database.Thanks.</b></center>";
require("password.php");
$acc_giris = (fopen("./sphereacct.scp","a"));
$p = password_to_crypted($pass);
$yeni_metin = "[$u_name]\nPASSWORD=$p\nPLEVEL=1\nPRIV=00000\n \n";
fwrite($acc_giris, $yeni_metin);
fclose($acc_giris);
}
} else {
echo "<center><b>Please enter a valid email adress</b></center>.";
}
} else {
echo "<center><b>You cant use a number more than 1 time in your password.</b></center>";
}
} else {
echo "<center><b>Please fill all the blanks and be sure that your password has more than 5 character
} else {
echo "<center><b>The username that you wanted is already a registered nick</b></center>";
}
?>