473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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:
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
1 3121
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Todd Gardner | last post by:
Pardon my extremely ignorant newbie questions. Where can I go to find more information about the "self" argument? Is there something special about the word "self" or did Mr. Guido van Rossum...
51
by: Noam Raphael | last post by:
Hello, I thought about a new Python feature. Please tell me what you think about it. Say you want to write a base class with some unimplemented methods, that subclasses must implement (or...
7
by: newseater | last post by:
Hello. I need to be able to control how objects are created. Sometimes when creating an object, i want to reuse another object instead. I've searched for factory method implementations and...
5
by: vilhelm.sjoberg | last post by:
Hello, I am a resonably confident C programmer, but not very sure about the dark corners of C++. Recently, I had G++ give me a strange error. The program in question is in essence: struct...
20
by: Wayne Sutton | last post by:
OK, I'm a newbie... I'm trying to learn Python & have had fun with it so far. But I'm having trouble following the many code examples with the object "self." Can someone explain this usage in...
11
by: O.B. | last post by:
Does C# support anything like PHP's break command that optionally accepts a parameter specifying how many loops to break out of?
13
by: Kurda Yon | last post by:
Hi, I found one example which defines the addition of two vectors as a method of a class. It looks like that: class Vector: def __add__(self, other): data = for j in range(len(self.data)):...
8
by: ssecorp | last post by:
I first learned about OO from Java. I much prefer to program in Python though. However I am consufed about 2 things. 1. Why do I have to pass self into every method in a class? Since I am...
13
by: Boris | last post by:
Can anyone tell me if Opera 9.5 is behaving correctly when wrapping the word C++, eg: C+ + Opera 9.2 didn't wrap C++. For those who use Opera 9.5 there is a test case at...
6
by: .rhavin grobert | last post by:
hello;-) i frequently need the following construction: ReturnParam § Function() § { /...do something.../ someType var § = something; /...do something.../ return something;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.