[FX.php List] php, filemaker and html forms

Steve Winter steve at bluecrocodile.co.nz
Fri Oct 29 18:10:43 MDT 2004


Nick,
 
I'll try and help you out, but it's tricky to gauge from what you've put
below how much you already have working... ;-)



[Code]
.... [php code]... 
//Does this php code include a call to a database in which you get the value
from the first database which you want to 'pass on'...??? something like;
 

include_once("/FX.php");
include_once("serverVariables.php");
 
  $classQuery = new FX($serverIP, $serverPort);
  $classQuery->SetDBData("firstDatabase.fp5", "web");
  $classQuery->AddDBParam(....Whatever the search criteria are...);
  $classData = $classQuery->FMFind();
  $classKey = key($classData['data'];
 
 
?>

<form action="confirm.php" method="post">
<input type="hidden" name="-db" value="dbname.fp5">   // Is the extension
needed? 
//Not required put this in confirm.php 
<input type="hidden" name="-lay" value="web"> 
//Not required forms part of your initiation of db in confirm.php 
<input type="hidden" name="-format" value="confirm.php"> 
//Not required at all, the 'action' in the form tag above has specified this
already   
<input name="First_name" type="text" size="20">
<input name="Last_name" type="text" size="20">
<input name="Phone_number" type="text" size="20">

<?php 
 //  echo('input type=hidden name=ClassID value=' . $value['ClassID'][0] .
'>'); 
//this is the right idea, but not quite right...
//presuming as I am that in the php code block above you've got the vale
from the first database, and the key value of the data
//then here you would;
 
 echo "<input type=hidden name=ClassID value=" .
$classData['Data'][$classKey]['ClassID'][0] . ">"; 
?>
<input type="Submit" name="new" value="Submit reservation">
[/Code]
 
Then on confirm.php you'd have (something like);
 
 
 
<?php
 
include_once("/FX.php");
include_once("serverVariables.php");
 
  $newQuery = new FX($serverIP, $serverPort);
  $newQuery->SetDBData("dbname.fp5", "web");
  $newQuery->AddDBParam('First_name', $_REQUEST['First_name']);
  $newQuery->AddDBParam('Last_name', $_REQUEST['Last_name']);  
  $newQuery->AddDBParam('Phone_number', $_REQUEST['Phone_number']);  
  $newQuery->AddDBParam('ClassID', $_REQUEST['ClassID']);
  $newData = $newQuery->FMNew();
  $newKey = key($contentData['data']);
 
?>
 
<html>
<body>
<p>Dear <?php echo $newData['data'][$newKey]['First_name'][0]; ?>,</p>
<p>Thanks for filling in the details on our website they have been save for
future reference.</p>
<p>Cheers</ br>Me</p>
</body>
</html>
 
Hope this helps and makes sense...let me know if you need further
assistance...
 
Cheers
Steve
 
Are these the correct input names to use?  In this case is the form action
page the same page as the -format page?

Thanks in advance,
Nick


----
Nick Trenary
Computer Information Systems Analyst
Cedar Rapids Public  <http://www.crlibrary.org/> Library
Office:(319) 398-5145 x267 
Work cell: (319) 310-7699 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20041030/a636b0e9/attachment.html


More information about the FX.php_List mailing list