Problems with ereg-Command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ( <number> <name> or <name>. <number>) 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&uuml;ltige Werte in Strasse";
	exit;
}

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

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

if (ereg("[0-9 ()/]",$fax) == false)
{
	echo "Ung&uuml;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@xxxxxxxx

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux