Problems with ereg-Command

Problems with ereg-Command

am 06.09.2007 12:07:32 von Ruprecht Helms

Hi,

I have some problems with validating the values of the fields street,
phone and fax. In the field street I want that only the european
standard for writing ( or . ) should be
possible. By other fieldentries the user should be informed of the error
and the proccessing should stop.

In the fields phone and fax it should be able to write (12345) 12345
or to write 12345 / 12345

The checking of the contactperson in german Ansprechpartner is also
incorrect.

if (!ereg("[a-zA-Z .0-9]",$strasse))
{
echo "Ungültige Werte in Strasse";
exit;
}

if (!ereg("[a-zA-Z] \.",$ansprechpartner))
{
echo "Ungültige Werte im Ansprechpartner";
exit;
}

if (ereg("[0-9 ()/]",$telefon) == false)
{
echo "Ungültige Werte bei Telefon";
exit;
}

if (ereg("[0-9 ()/]",$fax) == false)
{
echo "Ungültige Werte bei Fax";
exit;
}

What is the code for the correct validating.

Regards,
Ruprecht Helms
------------------------------------------------------------ -----------
Ruprecht Helms IT-Service & Softwaredevelopement

Web: http://www.rheyn.de
Mail: info@rheyn.de

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php