From: Ahmet Aksoy (ahmetax@postmark.net)
Date: Thu 10 Aug 2000 - 15:36:08 EEST
Merhaba,
Asagidaki PHP kod ornegi, uyesi oldugum bir baska listeden. Arkadas,
bir textbox icindeki email adresini kontrol edip, hatali oldugunda
kirmizi renkli bir mesajla adresi yazani uyarmak istiyormus.
Onerisi olan var mi? (Ben de PHP'ye yeni basladigim icin, henuz
pratik bir cozum oneremiyorum.)
Orjinal mesaj ve kod soyle:
I have a little code snippet which validates the validity of an
e-mail
address (making sure the @ sign is in the textbox). My question
specifically is, how would I go about doing a redirect or clearing
the page
and ONLY placing the red "E-mail address is not valid" text on the
page. I
tried this, but the form went ahead and processed even though the
address
was NOT valid. I'm wondering how I would stop the script from
processing
UNTIL my conditions are met.
The coding is below:
<?
function check()
if
(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$",
$email))
{
echo "<font color=red>
This is not a valid email</font><p>";
}
?>
Thanks.
Ahmet Aksoy
ahmetax@postmark.net
Listeden cikmak icin:
unsub linux
mesajini listeci@bilkent.edu.tr adresine gonderiniz.
Lutfen Listeci icin MIME / HTML / Turkce Aksan kullanmayin.
Listeci arayuzu: http://listweb.bilkent.edu.tr/yardim/bilkent/linux.html
Liste arsivinin adresi: http://listweb.bilkent.edu.tr/