Posted by Martin Jay on 09/28/43 11:47
In message <ib39g.68781$Tf1.64080@tornado.rdc-kc.rr.com>, Harold Ralston
<lumina_car@yahoo.com> writes
>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.";
>}
> ?>
Put the search in the an else. Or you could give $surname a nonsense
value before doing the search.
--
Martin Jay
Navigation:
[Reply to this message]
|