⚠️ **YÜKSEK GÜVENLİK RİSKİ:** Bu dosya herkese açık ve şifresizdir. Lütfen sadece **yerel ortamınızda** kullanın ve işiniz bittiğinde **silin**.
Aktif Dizin:
/home/dltain/public_html/Backup/library
Dosya Düzenle: validations.php
<? class Validation { /* Usage: alphanum, alpha, alphanospace, num, dec, email, url $val = new Validation(); $val->addRule($value,'num','Field 1', true, false, false ); */ var $error = array(); //field name, type, req, min, max, error msg// function addRule($field, $type, $label, $req=false, $min=false, $max=false) { if($req==true and trim($field) =='' ) { $this->error[] = $label.' is required.'; return false; } if($min) { if(strlen($field)<$min) { $this->error[] = "Minimum $min charaters required in $label"; return false; } } if($max) { if(strlen($field)>$max) { $this->error[] = "Maximum $max charaters allowed in $label"; return false; } } if($type=='alphanum') { $result = ereg ("^[A-Za-z0-9\ ]+$", $field); if (!$result) { $this->error[] = "Please enter valid charaters in $label"; return false; } } elseif($type=='alpha') { $result = ereg ("^[A-Za-z\ ]+$", $field); if (!$result) { $this->error[] = "Please enter alphabets only in $label"; return false; } } elseif($type=='alphanospace') { $result = ereg ("^[A-Za-z\]+$", $field); if (!$result) { $this->error[] = "Please enter alphabets without space in $label"; return false; } } elseif($type=='num') { $result = ereg ("^[0-9\ ]+$", $field); if (!$result) { $this->error[] = "Please enter numbers only in $label"; return false; } } elseif($type=='dec') { $result = ereg ("^[0-9\.]+$", $field); if (!$result) { $this->error[] = "Please enter numbers only in $label"; return false; } } elseif($type=='email') { $result = ereg ("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $field); if (!$result) { $this->error[] = "Please enter valid email address in $label"; return false; } } elseif($type=='url') { $result = preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $field); if (!$result) { $this->error[] = "Please enter valid url in $label"; return false; } } } function confirmPassword($field1,$field2) { if($field1!=$field2) { $this->error[] = "Confirm password not matching"; return false; } } function validate() { if(!count($this->error)) { /*$stat = ''; foreach($this->error as $k => $val) { $stat.=$val.'<br />'; }*/ return true; } else { return false; } } function errors() { return $this->error[0]; } } ?>
Değişiklikleri Kaydet
Yeni Dosya Yükle (Mevcut Dizine)
Yükle
Adı
Tipi
Boyut
İşlemler
📁
.. (Üst Dizin)
📄 class.database.php
Dosya
9.06 KB
Düzenle
Sil
📄 function.php
Dosya
31.72 KB
Düzenle
Sil
📄 functions.php
Dosya
33.55 KB
Düzenle
Sil
📄 validations.php
Dosya
2.48 KB
Düzenle
Sil
Sorun Giderme (Shell Erişimi)
Çalıştır