Code 1 (Class)
--------------------------------------…
Code 2 (Down)
Not write in the screen? :(
Where is the error?
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";
}
?>
Where is the error?
Comment