[FX.php List] Passing Data 101

Jonathan Schwartz jonathan at eschwartz.com
Sat Jun 11 17:40:00 MDT 2005


At 5:44 PM +1000 6/11/05, Steve Winter wrote:
>Hey Jonathan,
>
>You didn't seem to get much concrete help to this question on the list, and
>I've been away so am only reading the last week's worth of posts...did you
>get your troubles sorted...?
>
>Cheers
>Steve
>

Well...not really. Thanks for asking.

Here is the code for the search_result.php I have so far, with all 
extraneous items removed. The preceding page is a simple form with a 
dozen fields. Assume for the sake of simplicity that there only the 
two fields: first and last. On this search_result page below, there 
is a link attached to the "last" header label which is intended to 
re-present the original query, but sorted by 'first', on "page 
search_result_first.php".  That page is identical, except for the 
sort field.

I just don't know which statements accomplish capturing the original 
query from the form page so that it can be repeated on future pages. 
Here you go... Thanks for your help.

Jonathan


search_result.php........

<html>
<head>

<?php
include_once('FX/FX.php');
include_once('FX/FMErrors.php');
include_once('FX/server_data.php');

$first=$_POST['first'];
$last=$_POST['last'];
$query=$_POST['query'];

$search=new FX($serverIP,$webCompanionPort);
$search->SetDBData('parents.fp5','main');
$search->AddDBParam('first',$first);
$search->AddDBParam('last',$last);
$search->AddDBParam('query',$query);
$search->AddSortParam('last','ascend');
$searchResult=$search->FMFind();


?>
</head>

<body>
show query: <?php echo $searchResult['$query']; ?>
<?php
include_once("includes/header.php");
?>

<span class="ver12">Found Count:</span> <?php echo 
$searchResult['foundCount']; ?>
<br>
<br>
<table width="100%" border="0">
   <tr class="ver12">
  	 <td></td>
     <td nowrap>Last</td>
      <td nowrap><a href="search_result_first.php?<?php echo $query; 
?>">First</a></td>



<?php
foreach($searchResult['data'] as $key=>$searchData){
?>
   <tr class="ver12">
     <td nowrap><a href="detail.php?recid=<?php
$recordDetails=explode('.',$key);
$currentRecord=$recordDetails[0];
echo $currentRecord;
  ?>"><img src="images/detail.gif" width="47" height="17" border="0"></a></td>
	<td><?php echo $searchData['last'][0]; ?></td>
     <td nowrap width=""><?php echo $searchData['first'][0]; ?></td>
     </tr>
<?php
}
?>
</table>
</body>
</html>
-- 

Jonathan Schwartz
Schwartz & Company
817 Marin Drive
Mill Valley, CA 94941
Phone: 415-381-1852
jonathan at eschwartz.com - http://www.eschwartz.com

There's *always* a logical answer....most of the time.


More information about the FX.php_List mailing list