Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 20
Braincode mempunyai hidup yang Normal
Default [ask] register masalah.. [php]

gan wa da maslah saat validasi password neh..

wa pengenya biar password harus lebih dari 6 karakter sama kurang dari 25 karakter,,

ini scriptnya..



bingung salah dimana,

saolnya semua jadi gag jalan..


PHP Code:




$submit = $_POST['submit'];

//indexq

$username = strip_tags($_POST['username']);

$password = md5(strip_tags($_POST['password']));

$email = strip_tags($_POST['email']);

$retypepassword = md5(strip_tags($_POST['retypepassword']));

$polaemail = "/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/";

$nama= strip_tags ($_POST['nama_asli']);

$polauname= "/^[A-z0-9]{4,}$/";

//cek username

$edit = mysql_query("SELECT * FROM tb_user");

$r = mysql_fetch_array($edit);



if(
$submit){

//cek semua field gak boleh kosong

if($username&&$password&&$retypepassword&&$email&&$nama){

if(
$username == $r['username']){

echo
"Username sudah terpakai, cari yang lain

"
;

} else

if(
$email == $r['email']){

echo
"Email sudah terdaftar!!

"
;

} else

if(!
preg_match($polauname, $username)){

echo
"Perbaiki Username!!

"
;

} else



if(!
preg_match($polaemail, $email)){

echo
"Tolong isi Email!! [Ex. [email protected]]

"
;

}else

//cek pasword udah sama apa belom

if ($password == $retypepassword){

if(
strlen($password)>6 || strlen($password)
if ($password == $retypepassword){

if(
strlen($password)>6 || strlen($password)

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 01:00 AM.


no new posts