You are here: Re: Submit form with empty data « All PHP « IT news, forums, messages
Re: Submit form with empty data

Posted by Martie on 09/28/09 11:47

On Fri, 12 May 2006 17:01:02 GMT, Harold Ralston wrote...
>
>I have a page that searches my database for instances of the surname
>submitted through a POST form.
>
>http://www.ralstongenealogy.com/waterfordquery.php
>
>If a viewer submits it with the surname data blank empty, it brings
>up the entire data base to my results web page.
>
>I don't want this to happen. Instead I want to tell the viewer to
>submit a valid surname and show no results.
>
>So far I have this and want to add code that will not bring up any
>data to the results page. What do I need to add?
>
>Thanks for any help. Harold Ralston
>
><?php
>if(empty($surname))
>{
>echo "Please enter valid surname.";
>}
> ?>

It looks like that condition is printing the message, but you might need to add
an "else" loop to print the results if they aren't empty. The condition you have
above just prints an error message is applicable.


--
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth

 

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

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