472,110 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 software developers and data experts.

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

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:

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'); ?>

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 ?>">

<?php echo $contractor;?>
<select name="contractor">
<option>- select a contractor -</option> <?php
require('./search_logic/contractor_options.inc'); // generate
dropdown ?> </select>

<?php echo $jobname;?>
<select name="jobname">
<option>- select a jobname -</option> <?php
require('./search_logic/jobname_options.inc'); // generate dropdown
?> </select>

<td><input type=text size=15 name=model_or_section
value="<?php echo $model_or_section;?>" >
<td><input type=text size=15 name=description_keywords
value="<?php echo $description_keywords;?>">
<td><input type=text size=15 name=location
value="<?php echo$location;?>">
<td><input type=text size=10 name=material_list_id
value="<?php echo $material_list_id;?>"> </td>
/* 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"; }
{ $checkbox_status=""; }
<td><input type=checkbox name=prev_search_status <?php echo
$checkbox_status; ?> > </td>

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



// results here

if($show_all_lists == true)
{ require('./search_logic/show_all_lists.inc'); }
// start going into the breakdcown of the search logic.
if($number_of_search_categories ==1)
{ require('./search_logic/search_lists_single_category.inc'); }
{ 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">


<!-- Finish up the page -->
<?php require('../jobmonster_footer_one_level_deep.inc'); ?>
Jul 17 '05 #1
1 3038
"Danny Anderson" <bt*****@i.hate.spam> wrote in message
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.

Similar topics

3 posts views Thread by Todd Gardner | last post: by
51 posts views Thread by Noam Raphael | last post: by
7 posts views Thread by newseater | last post: by
5 posts views Thread by vilhelm.sjoberg | last post: by
20 posts views Thread by Wayne Sutton | last post: by
13 posts views Thread by Kurda Yon | last post: by
8 posts views Thread by ssecorp | last post: by
13 posts views Thread by Boris | last post: by
6 posts views Thread by .rhavin grobert | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.