By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,156 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

break out of self-processing form without header("foo.php");

P: n/a
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_list"] == "Choose List")
{ header("nextpage.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_lists"] == "Search" || $_REQUEST["refine_search"] ==
"Search Again" )
{
// handle form data here ...
}
?>

<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>"
onsubmit="return validate_list_selector_form(this);">

<input type="hidden" name="last_search_contractor"
value="<?php echo $contractor ?>">

<input type="hidden" name="last_search_jobname"
value="<?php echo $jobname ?>">

<tr>
<td>
<?php echo $contractor;?>
<select name="contractor">
<option>- select a contractor -</option> <?php
require('./search_logic/contractor_options.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_section
value="<?php echo $model_or_section;?>" >
</td>
<td><input type=text size=15 name=description_keywords
value="<?php echo $description_keywords;?>">
</td>
<td><input type=text size=15 name=location
value="<?php echo$location;?>">
</td>
<td><input type=text size=10 name=material_list_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_lists == true)
{ $checkbox_status="checked"; }
else
{ $checkbox_status=""; }
?>
<td><input type=checkbox name=prev_search_status <?php echo
$checkbox_status; ?> > </td>
</tr>

<tr>
<td><input type="submit" name="refine_search" value="Search Again">
<input type="reset" name="reset" value="Reset"> </td>
</tr>
</table>

<p>

<?php

// results here

if($show_all_lists == true)
{ require('./search_logic/show_all_lists.inc'); }
else
{
// start going into the breakdcown of the search logic.
if($number_of_search_categories ==1)
{ require('./search_logic/search_lists_single_category.inc'); }
else
{ require('./search_logic/search_lists_multiple_category.inc'); }
}
}
?>
<?php //this will have to have a redirect to the next page somehow! ?>

<input type="submit" name="choose_list" value="Choose List">

</form>

<!-- Finish up the page -->
<?php require('../jobmonster_footer_one_level_deep.inc'); ?>
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Danny Anderson" <bt*****@i.hate.spam> wrote in message
news:pa****************************@i.hate.spam...
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.


Well, don't send the header.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.