• 12-04-2009, 23:57:38
    #1
    arkadaşlar merhaba sitema hazır bir üyelik sistemini ekledim

    herşeyi ile süper oldu bazı alanlara üye olmadan girilemiyo felan

    ancak şimdi farkettim ki aynı üye adı ile yeni kayıtlar yapılabiliyor

    mesela

    editor kullanıcı isimli üye var
    fakat tekrar editor ismi ile kayıt yapılıyor

    bunu nasıl önlerim

    yeni üye kayıtta bu alanlar boş bırakılırsa hata mesajı gösterilmiş ama kullanılan üye adı için hiç hata vermiyor

    yardım edermisiniz lütfen







    kayit.php bu şekilde

    <center>
    <table border="1" cellspacing="1" style="border:1.5pt solid #0000FF;" width="28%" id="AutoNumber1" height="2" fpstyle="6,011111100">
      <tr>
        <td width="100%" colspan="2" height="18" style="border-bottom:1.5pt solid black; font-weight: bold; color: white; background-color: #000000; border-left-style:none; border-right-style:none; border-top-style:none">
        <p align="center"><b><font color="#0000FF" face="Verdana">Üye Kaydı</font></b></td>
      </tr>
      <tr>
        <td width="25%" height="22" style="font-weight: bold; color: black; border-style: none; background-color: silver">Ad Soyad</td>
        <td width="75%" height="22" style="color: navy; border-style: none; background-color: silver"><form action="uyekayit.php" method="post">&nbsp;&nbsp; <input type="text" name="ad" id="ad" size="20"></td>
      </tr>
      <tr>
        <td width="25%" height="22" style="font-weight: bold; color: black; border-style: none; background-color: silver">
        Üye Adı</td>
        <td width="75%" height="22" style="color: navy; border-style: none; background-color: silver">&nbsp; &nbsp;<input type="text" name="kullaniciadi" id="kullaniciadi" size="20"></td>
      </tr>
      <tr>
        <td width="50%" height="1" style="font-weight: bold; color: black; border-style: none; background-color: silver">
        <p align="left">Şifre</td>
        <td width="50%" height="1" style="font-weight: bold; color: black; border-style: none; background-color: silver">
        &nbsp;&nbsp; <input type="password" name="sifre" id="sifre" size="20"></td>
      </tr>
      <tr>
        <td width="50%" height="0" style="font-weight: bold; color: black; border-style: none; background-color: silver">
        E-Posta</td>
        <td width="50%" height="0" style="font-weight: bold; color: black; border-style: none; background-color: silver">
        &nbsp;&nbsp; <input type="text" name="posta" id="posta" size="20"></td>
      </tr>
      <tr>
        <td width="50%" height="0" style="font-weight: bold; color: black; border-style: none; background-color: silver">
        Kısaca kendinizi tanıtın</td>
        <td width="50%" height="0" style="font-weight: bold; color: black; border-style: none; background-color: silver">
        &nbsp;<p>
          <textarea rows="7" name="gorus" cols="20"></textarea></p>
        </td>
      </tr>
      <tr>
        <td width="100%" colspan="2" height="0" style="font-weight: bold; color: black; border-style: none; background-color: silver">
        <p align="center"><input type="submit" value="Gönder" name="B1"></form></td>
      </tr>
    </table>
    </center>


    ve

    uyekayit.php aşağıdaki gibidir
    <?php
    
    $ad = $_POST['ad'];
    $kullaniciadi = $_POST['kullaniciadi'];
    $sifre = $_POST['sifre'];
    $posta = $_POST['posta'];
    
    if(empty($ad)){
    echo("<center><b>Adınızı Yazmadınız. Lütfen Geri Dönüp Doldurunuz.</b></center>");
    }elseif(empty($kullaniciadi)){
    echo("<center><b>Kullanıcı Adınızı Yazmadınız. Lütfen Geri Dönüp Doldurunuz.</b></center>");
    }elseif(empty($sifre)){
    echo("<center><b>Şifrenizi Yazmadınız. Lütfen Geri Dönüp Doldurunuz.</b></center>");
    }elseif(empty($posta)){
    echo("<center><b>E-Postanızı Yazmadınız. Lütfen Geri Dönüp Doldurunuz.</b></center>");
    }else{
    include("ayar.php");
    $sql = "insert into uye (ad, kullaniciadi, sifre, email, gorus)
    values ('$ad', '$kullaniciadi', '$sifre', '$posta', '$gorus')";
    $kayit = mysql_query($sql);
    }
    if (isset ($kayit)){
    echo "<center>Üye Kaydınız Başarı ile Yapılmıştır<br><a style='color: red'><b><u>Şimdi giriş yaparak Program ekleyebilirsiniz</u></b></a></center>
    
    <center>
    <form action='uyegiris.php' method='post'>
    <table border='1' cellspacing='1' style='border:1.5pt solid #0000FF; ' width='28%' id='AutoNumber1' height='2' fpstyle='6,011111100'>
      <tr>
        <td width='100%' colspan='2' height='18' style='border-bottom:1.5pt solid black; font-weight: bold; color: white; background-color: #000000; border-left-style:none; border-right-style:none; border-top-style:none'>
        <p align='center'><b><font color='#0000FF' face='Verdana'>Üye Girişi</font></b></td>
      </tr>
      <tr>
        <td width='25%' height='22' style='font-weight: bold; color: black; border-style: none; background-color: silver'>Üye Adı</td>
        <td width='75%' height='22' style='color: navy; border-style: none; background-color: silver'>&nbsp;&nbsp; <input type='text' name='kullaniciadi' size='20'></td>
      </tr>
      <tr>
        <td width='25%' height='22' style='font-weight: bold; color: black; border-style: none; background-color: silver'>Şifre</td>
        <td width='75%' height='22' style='color: navy; border-style: none; background-color: silver'>&nbsp;&nbsp; <input type='password' name='sifre' size='20'></td>
      </tr>
      <tr>
        <td width='100%' colspan='2' height='1' style='font-weight: bold; color: black; border-style: none; background-color: silver'>
        <p align='center'><input type='submit' value='Gönder'></td>
      </tr>
    </table>
    </form>
    </center>
    
    
    ";
    
    
    }
    else {
    echo "Kayıt Başarısız";
    }
    ?>
  • 13-04-2009, 00:16:39
    #2
    Üyeliği durduruldu
    kaydetmeden önce kontrol etmeniz gerekiyor
    $result = mysql_query("select * from uye where kullaniciadi='".mysql_real_escape_string($kullaniciadi)."'");
    if(mysql_num_rows($result)>0){
    // hata mesajı ver
    }
  • 13-04-2009, 00:18:18
    #3
    $kadi = 'Sql';
    if (mysql_num_rows($kadi)>0) {
    echo 'kayitli';
    }else{
    ///kodların
    }
  • 13-04-2009, 00:23:24
    #4
    arkadaşlar bu kodları tam olarak nereye ekleyeceğimi söyliye bilirmisiniz lütfen
    biraz yeniyim bu işlerde sabahtan beri anca siteye ekleyebildim üyelik sistemini zaten

    yardımlarınız için şimdiden teşekkürler
  • 13-04-2009, 00:29:18
    #5
    <?php
    
    $ad = $_POST['ad'];
    $kullaniciadi = $_POST['kullaniciadi'];
    $sifre = $_POST['sifre'];
    $posta = $_POST['posta'];
    
    if(empty($ad)){
    echo("<center><b>Adınızı Yazmadınız. Lütfen Geri Dönüp Doldurunuz.</b></center>");
    }elseif(empty($kullaniciadi)){
    echo("<center><b>Kullanıcı Adınızı Yazmadınız. Lütfen Geri Dönüp Doldurunuz.</b></center>");
    }elseif(empty($sifre)){
    echo("<center><b>Şifrenizi Yazmadınız. Lütfen Geri Dönüp Doldurunuz.</b></center>");
    }elseif(empty($posta)){
    echo("<center><b>E-Postanızı Yazmadınız. Lütfen Geri Dönüp Doldurunuz.</b></center>");
    }else{
    include("ayar.php");
    $sqlas = mysql_query("select * from uye where kullaniciadi='".mysql_real_escape_string($kullaniciadi)."'"); 
    if(mysql_num_rows($sqlas)>0){ 
    echo 'kadivar';
    }else{
    
    
    
    $sql = "insert into uye (ad, kullaniciadi, sifre, email, gorus)
    values ('$ad', '$kullaniciadi', '$sifre', '$posta', '$gorus')";
    $kayit = mysql_query($sql);
    }
    if (isset ($kayit)){
    echo "<center>Üye Kaydınız Başarı ile Yapılmıştır<br><a style='color: red'><b><u>Şimdi giriş yaparak Program ekleyebilirsiniz</u></b></a></center>
    
    <center>
    <form action='uyegiris.php' method='post'>
    <table border='1' cellspacing='1' style='border:1.5pt solid #0000FF; ' width='28%' id='AutoNumber1' height='2' fpstyle='6,011111100'>
      <tr>
        <td width='100%' colspan='2' height='18' style='border-bottom:1.5pt solid black; font-weight: bold; color: white; background-color: #000000; border-left-style:none; border-right-style:none; border-top-style:none'>
        <p align='center'><b><font color='#0000FF' face='Verdana'>Üye Girişi</font></b></td>
      </tr>
      <tr>
        <td width='25%' height='22' style='font-weight: bold; color: black; border-style: none; background-color: silver'>Üye Adı</td>
        <td width='75%' height='22' style='color: navy; border-style: none; background-color: silver'>&nbsp;&nbsp; <input type='text' name='kullaniciadi' size='20'></td>
      </tr>
      <tr>
        <td width='25%' height='22' style='font-weight: bold; color: black; border-style: none; background-color: silver'>Şifre</td>
        <td width='75%' height='22' style='color: navy; border-style: none; background-color: silver'>&nbsp;&nbsp; <input type='password' name='sifre' size='20'></td>
      </tr>
      <tr>
        <td width='100%' colspan='2' height='1' style='font-weight: bold; color: black; border-style: none; background-color: silver'>
        <p align='center'><input type='submit' value='Gönder'></td>
      </tr>
    </table>
    </form>
    </center>
    
    
    ";
    
    
    }
    else {
    echo "Kayıt Başarısız";
    }
    
    }
    ?>
  • 13-04-2009, 00:56:05
    #6
    kale200 teşekkür ederim + rep

    sorunsuz halletim sayende


    mesaj yazan diğer arkadaşlarımada teşekkür ederim
  • 13-04-2009, 13:28:05
    #7
    phpmyadmin den üye adının olduğu kolonu unique olarak ayarlarsan kesin çözüm olur