Php code where is the error?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yusuf Ali
    New Member
    • Sep 2010
    • 7

    Php code where is the error?

    Code 1 (Class)

    Code:
    public function UyeKayit($adres, $ad, $soyad, $mail, $sifre1, $sifre2, $gsm, $il){
    if (filter_var($mail,FILTER_VALIDATE_EMAIL)…
    $preg1 = true;
    }else{
    $preg1 = false;
    }
    if (preg_match('/^[a-z\d_]{5,20}$/i', $ad)){
    $preg2 = true;
    }else{
    $preg2 = false;
    }
    if (preg_match('/^[a-z\d_]{5,20}$/i', $soyad)){
    $preg3 = true;
    }else{
    $preg3 = false;
    }
    if (filter_var($gsm,FILTER_SANITIZE_NUMBER_…
    $preg4 = true;
    }else{
    $preg4 = false;
    }
    if ($sifre1 === $sifre2 and preg_match('/^[a-z\d_]{5,20}$/i', $sifre1)){
    $sifre = md5($sifre1);
    }else{
    $preg5 = false;
    }
    if (preg_match('/^[a-z\d_]{5,20}$/i', $il)){
    $preg6 = true;
    }else{
    $preg6 = false;
    }
    $ip = $_SERVER['REMOTE_ADDR'];
    $adres = stripslashes($adres);
    $sql = "insert into kullanıcılar (k_adres,k_ad,k_soyad,k_posta,k_sifre,k_… values ('$adres','$ad','$soyad','$mail','$sifre… ";
    if (mysql_query($sql,$this->BaglanDB())){
    return $sonuc = true;
    }else{
    return $sonuc = false;
    }
    return array($preg1, $preg2, $preg3, $preg4, $preg5, $preg6, $sonuc);
    }
    --------------------------------------…

    Code 2 (Down)

    Code:
    <?php
    require_once('classes/db.class.php');
    $veri = array();
    $adres = $_POST['adres'];
    $ad = $_POST['ad'];
    $soyad = $_POST['soyad'];
    $mail = $_POST['mail'];
    $sifre1 = $_POST['sifre1'];
    $sifre2 = $_POST['sifre2'];
    $gsm = $_POST['gsm'];
    $il = $_POST['il'];
    
    $uyekayit = new DBekle();
    list($preg1, $preg2, $preg3, $preg4, $preg5, $preg6, $sonuc) = $uyekayit->UyeKayit($adres,$ad,$soyad,$m…
    $uyekayit->UyeKayit($adres,$ad,$soyad,…
    if ($sonuc == true){
    echo "kayıt eklendi";
    }
    ?>
    Not write in the screen? :(
    Where is the error?
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Do you have error reporting turned on?


    Dan

    Comment

    • Yusuf Ali
      New Member
      • Sep 2010
      • 7

      #3
      Not write in the screen? :( no error :(

      Thank you

      Comment

      • dlite922
        Recognized Expert Top Contributor
        • Dec 2007
        • 1586

        #4
        That's not what I asked. You need to turn ON error reporting to SEE errors on screen.

        For security reasons, production PHP install has it off.




        Dan

        Comment

        Working...