You are here: a couple of problems with PHP form « PHP « IT news, forums, messages
a couple of problems with PHP form

Posted by Bruce Gilbert on 10/10/41 11:29

I am trying to set up some validation for my php form with the email
field using the following code:

if(!eregi("^(.+)@(.+)\\.(.+)$",$_POST['email']))
{
$error_msg .= "<BR />Your email appears to be invalid.";
$ok = "false";
}


I am trying to accomplish not being able to enter anything other than
a valid email string
.....this doesn'r seem to be doing anything.

also, I want the field to appear hilighted when there is no
information so I am doing this:


<input class="<? if($error_msg){ echo "error"; } ELSE { echo
"normal"; } id="firstname" name="firstname" type="text"
value="{$_POST['firstname']}"? />"

and I have an error class set up in my CSS, such as

.error {border: 1px solid red;}

this is not doinf anything either.

Can somone point out what may be wrong with this PHP code?

thanks,

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация