I am creating a web-based search application on a MYSYQL database with PHP. The application has three basic components:
-
A SEARCH FORM (advanced_search.php) with several options – I have made good progress on this component and it appears to be working just fine. The form data is being collected and posted to the search results in step 2.
-
A SEARCH RESULTS file (search_results.php) where basic document data is revealed in a list. The item in each row is a unique document identifier filtered on the search form in step 1 and linked to the full document in step 3. The data is being displayed ok as a link in each row and I can click the link and pull up the next step.
-
A DOCUMENT TEXT (sectiontext.php) file with the associated full document text. The page loads from the link in the Search Results list, but there is no text data displayed. If I hard code a FullDocumentID into the query, it does pull up the correct document text for that ID. So I assume that it should work if I can just get the appropriate FullDocumentID transferred from step 2.
I have tried using both Get and Post to transfer the data, but seem to be having a problem. Here is the code I am currently using on the Search Results page which I think is relying on the Get method:
$result1 = mysql_query(“SELECT …”);
for ($a=0; $a < mysql_num_rows($result1); $a++)
{
$SQL_Array=mysql_fetch_array($result1);
$full_doc_number=$SQL_Array[‘full_doc_number’];
$FullDocumentID=$SQL_Array[‘FullDocumentID’];
echo “<a href=\ecr/sectiontext.php?ID=FullDocumentID”>$full_doc_number
";
}
This displays the data correctly as a list on the search_results page with links that pull up the sectiontext.php page, but no document text is displayed (empty table, no errors). It does not seem to be displaying the FullDocumentID number in the URL for the sectiontext.php in the browser. For example:
http://www… /sectiontext.php?ID=FullDocumentID"
There is no number for the FullDocumentID. I think this may be the problem, but since I am new to PHP, I could be missing something obvious.
I have also tried to Post the data between the pages with this code on both the search_results.php and sectiontext.php pages with no luck:
$FullDocumentID=$_POST[‘FullDocumentID’];
Any help getting this solved is appreciated. - Dave