473,721 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_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'); ?>
Jul 17 '05 #1
1 3139
"Danny Anderson" <bt*****@i.hate .spam> wrote in message
news:pa******** *************** *****@i.hate.sp am...
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
2430
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 just decide to us the word arbitrarily? More precisely it seems that most all classes have "self" as the first parameter. This may be directly obvious but is the word "self" always referring to the class or the function it is used in?
51
6989
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 maybe even just declare an interface, with no methods implemented). Right now, you don't really have a way to do it. You can leave the methods with a "pass", or raise a NotImplementedError, but even in the best solution that I know of,
7
1380
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 singleton implementations. They were too much of a hack! My first attempt of doing this was to play around with the __new__() method. But i didn't quite succed. Then i came up with making a static method which can create my instances or re-use other...
5
7256
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 foo { };
20
2862
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 plain english? Thanks, Wayne
11
9713
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
12015
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)): data.append(self.data + other.data)
8
2702
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 always doing why cant this be automated or abstracted away? Are the instances where I won't pass self? I imagine there is some tradeoff involved otherwise it would have been
13
1940
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 http://www.highscore.de/browsertest/cpp.html (try different window sizes until Opera 9.5 wraps C++).
6
2403
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
8840
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8730
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.