You are here: there must be a better way « All PHP « IT news, forums, messages
there must be a better way

Posted by Pasquale on 08/03/05 04:30

The snippet of code below is what I use at the top of my script to
declare and 'filter' my variables. I was going to put them in a seperate
file to make them portable and include them in other registrations. The
potential problem is if each team member has more than just 4 or 5
pieces of information, like say 20. If there are 10 members with 20
pieces of information, it can get long and repetitive.

I just have a feeling there is a better way of doing this, correct? Can
classes be used? If so, an example would be appreciated. I'm trying to
use classes and whatever else I can to make my code better and cleaner,
so any other suggestions would also be appreciated.

Thanks.


$stg1name = NameFilter($stg1name);
$stg1email = EmailFilter($stg1email);
$stg1gndr = Filter($stg1gndr);
$stg1age = NumberFilter($stg1age);
$stg1shirt = Filter($stg1shirt);


$stg2... to $stg9...


$stg10name = NameFilter($stg10name);
$stg10email = EmailFilter($stg10email);
$stg10gndr = Filter($stg10gndr);
$stg10age = NumberFilter($stg10age);
$stg10shirt = Filter($stg10shirt);

<<snip>>

 

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

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