Oleh: awaludinfajari | Oktober 1, 2011

Sourcecode PHP:Validasi Penulisan Email

<font face="Verdana" size="2">
<form name="form" method="POST" action="">
Isi Email Anda <input type="text" name="email">
<input type="submit" name="cek" value="Cek Email">
<?php
$valid_mail="^([.a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3}))$";
$email=$_POST['email'];
if(!eregi($valid_mail,$email)){
echo"<br><b>Penulisan alamat $email salah</b>";
}else{
echo"<br>penulisan $emailĀ  benar";
}
?>


Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Kategori

%d blogger menyukai ini: