Reply to Re: using forms to add records to mysql database - block submit on entering

Your name:

Reply:


Posted by Michael Fesser on 09/06/07 17:04

..oO(dirk)

>I'm new to php and I'm trying to write some php code so that I can
>insert data into a mysql database using html forms.
>
>I've got two text forms and a submit button. When entering data and
>selecting 'submit' a new record in my database is created. So far so
>good... But when I enter data in only one content and hit the enter
>key a new record is created with one empty field. And that something I
>don't want to happen.

Use your PHP script to check that all required values are there and
reject the form submission if something is missing. Show an error
message and the form with all previously entered values again.

>Is there a way to block the text-forms so only a record is added when
>I hit the 'submit' button?

No. Don't even try it. Fix it on the server.

Micha

[Back to original 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

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