You are here: recommended way for server side validation - include in same file or have a different file « PHP « IT news, forums, messages
recommended way for server side validation - include in same file or have a different file

Posted by Vinayakam Murugan on 03/08/05 13:11

Hi

I have always felt for reasons for cleanliness and clarity, it is
better to have the validation and insert / update statements in a
seperate file rather than have it in the same script.

Case 1
----------
//file:form.php
if $_POST
then validate
Insert or update on success
else
if $_GET['primarykey'] then
show form for editing
else
show form for adding
fi
<form action="form.php" method=post>
Show form
</form>

Case 2
----------
//file:form1.php
if $_GET['primarykey'] then
show form for editing
else
show form for adding
fi
<form action="formvalidate.php" method=post>
Show form
</form>



However in the second case, in case of an error, displaying the data
becomes an issue.

Any recommended ways for server side validation

--
Warm Regards
~~~~~~~~~~~~
Vinayak

 

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

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