0
echo '<h3>Yeni Yönetici Ekleme Ekranı...</h3><br><br>';
	if (isset($_POST['submit']) && $_POST['submit'] == "Kaydet"){
	if ($_POST['usernname'] != "" && $_POST['password'] != "" && $_POST['first_name'] != "" && $_POST['last_name'] != "" && $_POST['email'] != "" && $_POST['TCK'] != "") {
		$query = "SELECT username FROM users WHERE username = '".$_POST['username']."';";
		$result = mysql_query($query) or die(mysql_error());
		$querya = "SELECT adminname FROM admins WHERE adminname = '".$_POST['username']."';";
		$resulta = mysql_query($querya) or die(mysql_error());
		
		if(mysql_num_rows($result) != 0 && mysql_num_rows($resulta)){
?>
<p style="margin-top:50px;"><center>
<font color="#FF0000"><b> Kullanıcı Adı :
<?php echo $_POST['username']; ?>, zaten kullanılmakta, l&uuml;tfen başka bir kullanıcı adı se&ccedil;iniz!</b></font>
<form action="admin_panel.php?select=10" method="post" >
	Kullanıcı Adı : <input type="text" name="username" value= "<?php echo $_POST['username']; ?>" ><br>
    Şifre         : <input type="password" name="password" value= "<?php echo $_POST['password']; ?>" ><br>
    E-mail        : <input type="text" name="email" value= "<?php echo $_POST['email']; ?>" ><br>
    Adınız        : <input type="text" name="first_name" value="<?php echo $_POST['first_name']; ?>" ><br>
    Soyadınız     : <input type="text" name="last_name" value="<?php echo $_POST['last_name']; ?>" ><br>
    TC Kimlik No  : <input name="TCK" type="text" value="<?php echo $_POST['TCK']; ?>"><br><br>
   <input type="submit" name="submit" value="Kaydet"> &nbsp;
   <input type="reset" value="Temizle">
</form>
</center></p>
<?php
		} else {
			$querya = "INSERT INTO admins (adminname, password) VALUES ('".$_POST['username']."', '".$_POST['password']."')"; 
			$query = "INSERT INTO users (username, password, email, f_name, l_name, workplace, status, TCK)".
					 "VALUES ('".$_POST['username']."', '".$_POST['password']."', '".$_POST['email']."', '".$_POST['first_name']."', '".$_POST['last_name']."','Unknown', '0', '".$_POST['TCK']."');";
		    mysql_query($querya) or die(mysql_error());
		    mysql_query($query) or die(mysql_error());
?>
<p style="margin-top:50px;"><center>
<?php
		echo 'Kayıt işleminiz tamamlandı! Giriş yapılıyor...<br></p></center>';
		}
	} else {
?>

<p style="margin-top:50px;"><center>
<font color="#FF0000"><b> T&uuml;m alanları Doldurmanız Zorunludur...</b></font>
<form action="admin_panel.php?select=10" method="post">
	Kullanıcı Adı :<br /> <input type="text" name="username" value= "<?php echo $_POST['username']; ?>" ><br>
    Şifre         :<br /> <input type="password" name="password" value= "<?php echo $_POST['password']; ?>" ><br>
    E-mail        :<br /> <input type="text" name="email" value= "<?php echo $_POST['email']; ?>" ><br>
    Adınız        :<br /> <input type="text" name="first_name" value="<?php echo $_POST['first_name']; ?>" ><br>
    Soyadınız     :<br /> <input type="text" name="last_name" value="<?php echo $_POST['last_name']; ?>" ><br>
    TC Kimlik No  :<br /> <input type="text" name="TCK" value="<?php echo $_POST['TCK']; ?>" ><br><br>
   <input type="submit" name="submit" value="Kaydet"> &nbsp;
   <input type="reset" value="Temizle">
   </form>
</center></p>
<?php
	}
} else {
?>
<p style="margin-top:50px;"><center>
Kayıt Sayfamıza Hoşgeldiniz!<br>
T&uuml;m alanların doldurulması zorunludur!
<form action="admin_panel.php?select=10" method="post">
	Kullanıcı Adı :<br /> <input type="text" name="username"><br>
    Şifre         :<br /> <input type="password" name="password"><br>
    E-mail        :<br /> <input type="text" name="email"><br>
    Adınız        :<br /> <input type="text" name="first_name"><br>
    Soyadınız     :<br /> <input type="text" name="last_name"><br>
    TC Kimlik No  :<br /> <input type="text" name="TCK"><br><br>
   <input type="submit" name="submit" value="Kaydet"> &nbsp;
   <input type="reset" value="Temizle">
</form>
</center></p>

I'm having some difficulties with submit

if ($_POST['usernname'] != "" && $_POST['password'] != "" && $_POST['first_name'] != "" && $_POST['last_name'] != "" && $_POST['email'] != "" && $_POST['TCK'] != "")

This code seems to be not working the code always ended with " T&uuml;m alanları Doldurmanız Zorunludur..." in english "There are some empty cells in the form you have to fill them". Can someone tell me what did I write wrong? By the way I checked the parahantesis they are all at the right places. Thank you.

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by astala27
0

Code always goes to the line 40, even if filled and submited.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.