Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199807

Re: [PHP3] how to change the target From: Richard Lynch (lynch <email protected>)
Date: 07/31/98

At 12:14 PM 7/30/98, Grace Pastorelly Ruiz wrote:
>hi,
>i have a page with a form that has a input field, a text filed,
>when you press the Enter key or a submit, my script search into a
>database,
>if i find more than 1 row that match my search, i'll want show the
>information on a frame
>and if there is only one row i'll need to show the data on another
>frame, different frame.

This sounds extremely goofy to me, but I'll take it on faith that you
actually want this...

>how can i do that, any idea??

>From a database management perspective, this solution is ugly as hell...
but it will work, and most closely conforms to what you seem to want...

resultsmain.php
------------------------------------------------------------------------------
<?php
  $searchkey = "Search key from user input.";
  /* Put code here that just figures out how many answers there will be: */
  $rowcount = 1; /* Change this line to other numbers to test logic. */
?>
<HTML>
  <HEAD>
    <TITLE>Main Page - Uses Frames</TITLE>
    <?php
      if ($rowcount == 1){
        echo("<FRAMESET COLS=\"80,*\">\n");
        echo(" <FRAME SRC=toolbar.htm>\n">
        echo(" <FRAME SRC=onerowframe.php?key=$searchkey>\n");
        echo("</FRAMESET>\n");
      }
      else{
        echo("<FRAMESET COLS=\"80,*\">\n");
        echo(" <FRAME SRC=toolbar.htm>\n">
        echo(" <FRAME multiplerowframe.php?key=$searchkey>\n");
        echo("</FRAMESET>\n");
      }
    ?>
  </HEAD>
</HTML>

toolbar.htm
-----------
This is the toolbar.<BR>

onerowframe.php
---------------
<?php
  /* use $key to perform the actual search and output the results. */
  echo("One Result for key $key<BR>\n");
?>

multiplerowframe.php
--------------------
<?php
  /* Use $key to perform the actual search and output the results. */
  echo("Multiple results for key $key<BR>\n");
?>

Dislaimer: I've never done this, and never will, but it should work.

--
--
-- "TANSTAAFL" Rich lynch <email protected>

-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3