Hola, PHP folk!
I have a php page that contains a self-processing form. The form holds
search results. The search terms originally came from the previous page,
but the user can repeatedly refine the results on the page in question
until the target item can be found. This search refinement is where the
self-processing form comes to play.
The search results are listed in a table with a radio button at the end of
each row. What I would like to do is have the user click the radio button
at the end of the row that lists their target and then click the "Choose
This" button, whereupon they would be directed to the next page, along
with the unique ID of the row they chose.
How do I break out of the self processing part of this form?
I originally tried to use a redirect, something like this:
if($_REQUEST["choose_lis t"] == "Choose List")
{ header("nextpag e.php"); }
This doesn't work in my pages, because I already have a stock header at
the beginning of the page, and this type of redirect conflicts with the
headers I have already sent.
Comments and suggestions appreciated!
---
The rough version of the page can be reached by performing an inital
search (try one of the pull-down values) here:
http://www.bturnip.com/jobmonster/ma...sting_list.php
The next page (edit_existing_ list_step1.php) is where I am stuck in my
self processing form.
---
Server info: apache 3.29.x, php 4.3.7
---
Snipped source code of "edit_existing_ list_step1.php"
<?php require_once('. ./header.php'); ?>
<?php
if ($_REQUEST["search_lis ts"] == "Search" || $_REQUEST["refine_sea rch"] ==
"Search Again" )
{
// handle form data here ...
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>"
onsubmit="retur n validate_list_s elector_form(th is);">
<input type="hidden" name="last_sear ch_contractor"
value="<?php echo $contractor ?>">
<input type="hidden" name="last_sear ch_jobname"
value="<?php echo $jobname ?>">
<tr>
<td>
<?php echo $contractor;?>
<select name="contracto r">
<option>- select a contractor -</option> <?php
require('./search_logic/contractor_opti ons.inc'); // generate
dropdown ?> </select>
</td>
<td>
<?php echo $jobname;?>
<select name="jobname">
<option>- select a jobname -</option> <?php
require('./search_logic/jobname_options .inc'); // generate dropdown
?> </select>
</td>
<td><input type=text size=15 name=model_or_s ection
value="<?php echo $model_or_secti on;?>" >
</td>
<td><input type=text size=15 name=descriptio n_keywords
value="<?php echo $description_ke ywords;?>">
</td>
<td><input type=text size=15 name=location
value="<?php echo$location;? >">
</td>
<td><input type=text size=10 name=material_l ist_id
value="<?php echo $material_list_ id;?>"> </td>
<?php
/* Determine if the show all checkbox was checked in the previous
* search. If so, check it again as the default
*/
if($show_all_li sts == true)
{ $checkbox_statu s="checked"; }
else
{ $checkbox_statu s=""; }
?>
<td><input type=checkbox name=prev_searc h_status <?php echo
$checkbox_statu s; ?> > </td>
</tr>
<tr>
<td><input type="submit" name="refine_se arch" value="Search Again">
<input type="reset" name="reset" value="Reset"> </td>
</tr>
</table>
<p>
<?php
// results here
if($show_all_li sts == true)
{ require('./search_logic/show_all_lists. inc'); }
else
{
// start going into the breakdcown of the search logic.
if($number_of_s earch_categorie s ==1)
{ require('./search_logic/search_lists_si ngle_category.i nc'); }
else
{ require('./search_logic/search_lists_mu ltiple_category .inc'); }
}
}
?>
<?php //this will have to have a redirect to the next page somehow! ?>
<input type="submit" name="choose_li st" value="Choose List">
</form>
<!-- Finish up the page -->
<?php require('../jobmonster_foot er_one_level_de ep.inc'); ?>