Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-07 Thread Richard Lynch
On Thu, October 6, 2005 9:37 am, Robert Cummings wrote:
>> > when I add that code I can the following error msg when submitting
>> the
>> > form.
>> > " *Warning*: Cannot modify header information - headers already
>> sent by
>> > (output started at /home/webadmin/dedicated75.virtual.vps-
>> > host.net/html/fortuneInteractive/Consultation_test.php:6
>> > )
>> > in */home/webadmin/dedicated75.virtual.vps-
>> > host.net/html/fortuneInteractive/Consultation_test.php
>> > 
>> > * on line *168* "
>> > line 168 is the one with header( 'Location: thanks.php' );
>> > on it.
>> > can anyone explain why this is happening and how to rectify?

A long time ago, this error message would only have told you that the
line 168 was "wrong" and that data had already been sent earlier.

Now, however, buried in this error message, is the EXACT LINE of code
where the data was already sent:

/home/webadmin/dedicated75.virtual.vps-host.net/html/fortuneInteractive/Consultation_test.php:6

Line 6, of Consultation_test.php is the culprit.

WARNING:
Emacs, by default, on some system, will automatically ADD a newline
character at the end of any file you edit.

In older versions of PHP (possibly pre-dating this error message) that
would be problematic.  It may STILL be problematic for all I know.  I
don't use Emacs, but recall the grief it caused many a PHP beginner
from long ago on the list.

Disclosure:
I may have been the first/loudest to request that the original line of
data output be logged by PHP internally so that this message could
inform you of this fact.  Hell, for all I know, I'm the only guy that
asked for it.  Oh well.  It's there.  Use it.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-06 Thread Bruce Gilbert
when I put the die statment in and test the form I get, the html prior to
the form and what I put in my die statement eg:"made it to this point". The
form submits and I get the info, but I am not redirected to the Thanks page.

 My question is how do I determine from this what is causing my error?

 On 10/6/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
>
> You don't have to put anything specific, it just stops the script from
> executing.
>
> You can optionally put text in there. I like using die() for some reason
> (shorter? more.. err.. aggressive? hah) so I'll using commands like:
>
> die("Made it to this point...");
>
> I might use this to see if I got to a certain conditional or not..
>
> Anyway, if you're getting that error, then there's definitely something
> being sent before the header() is executed.
>
> Check any require() or include() files, check all the code above your
> header() statement. So far I've never seen or heard of any bugs with
> header() where it'd mysteriously bomb out in this manner, it's always been
> something output and it's always been something people kick themselves for
> not seeing before. hah
>
> Keep looking, you'll find it.
>
> -TG
>
> = = = Original message = = =
>
> I checked and no white space involved. What would I need to put tin the
> exit()/die() function?
>
> --
> ::Bruce::
>
>
> ___
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
>
>


--
::Bruce::


Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-06 Thread tg-php
You don't have to put anything specific, it just stops the script from 
executing.

You can optionally put text in there.  I like using die() for some reason 
(shorter? more.. err.. aggressive? hah)  so I'll using commands like:

die("Made it to this point...");

I might use this to see if I got to a certain conditional or not..

Anyway, if you're getting that error, then there's definitely something being 
sent before the header() is executed.

Check any require() or include() files, check all the code above your header() 
statement.  So far I've never seen or heard of any bugs with header() where 
it'd mysteriously bomb out in this manner, it's always been something output 
and it's always been something people kick themselves for not seeing before. hah

Keep looking, you'll find it.

-TG

= = = Original message = = =

I checked and no white space involved. What would I need to put tin the
exit()/die() function?

--
::Bruce::


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-06 Thread Robert Cummings
Here's the simple solution (put it at the top of your script:

ob_start();

Cheers,
Rob.

On Thu, 2005-10-06 at 10:30, Bruce Gilbert wrote:
> I checked and no white space involved. What would I need to put tin the
> exit()/die() function?
> 
> On 10/6/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> >
> > Check to make sure absolutely nothing before the header() function is
> > outputing anything. No echos, no prints, no var_dumps, no HTML or even blank
> > lines.
> >
> > If it's something tangible like an echo or print or something, then
> > putting an exit()/die() function right before the header() function then
> > looking at the HTML source that you get should show you what the offending
> > output is.
> >
> > But again, if I recall, it can be something as simple as an empty line.
> >
> > -
> >  >
> > // This should work because there's no output or white space above
> > header()
> > header('Location: thanks.php');
> >
> > ?>
> > -
> >
> > -
> >
> >  >
> > // This should fail (if I recall) because of the blank line that's sent
> > // before the PHP code block. This is considered output, and can't come
> > before
> > // any header statements
> >
> > header('Location: thanks.php');
> >
> > ?>
> > -
> >
> >
> > = = = Original message = = =
> >
> > when I add that code I can the following error msg when submitting the
> > form.
> > " *Warning*: Cannot modify header information - headers already sent by
> > (output started at /home/webadmin/dedicated75.virtual.vps-
> > host.net/html/fortuneInteractive/Consultation_test.php:6
> > )
> > in */home/webadmin/dedicated75.virtual.vps-
> > host.net/html/fortuneInteractive/Consultation_test.php
> > 
> > * on line *168* "
> > line 168 is the one with header( 'Location: thanks.php' );
> > on it.
> > can anyone explain why this is happening and how to rectify?
> > TIA
> >
> > On 10/5/05, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > >
> > > On Wed, 2005-10-05 at 21:15, Bruce Gilbert wrote:
> > > > thanks for the reply.
> > > >
> > > > and where on the page would that need to go? Within the head tags?
> > > > and would it need to be within 
> > >
> > > Right after this line:
> > >
> > > mail ($to, $subject, $msg, $mailheaders);
> > >
> > > And you will already be within PHP interpretation.
> > >
> > > Cheers,
> > > Rob.
> > > --
> > > ..
> > > | InterJinn Application Framework - http://www.interjinn.com |
> > > ::
> > > | An application and templating framework for PHP. Boasting |
> > > | a powerful, scalable system for accessing system services |
> > > | such as forms, properties, sessions, and caches. InterJinn |
> > > | also provides an extremely flexible architecture for |
> > > | creating re-usable components quickly and easily. |
> > > `'
> > >
> > >
> >
> >
> > --
> > ::Bruce::
> >
> >
> > ___
> > Sent by ePrompter, the premier email notification software.
> > Free download at http://www.ePrompter.com.
> >
> >
> 
> 
> --
> ::Bruce::
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-06 Thread Bruce Gilbert
I checked and no white space involved. What would I need to put tin the
exit()/die() function?

On 10/6/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
>
> Check to make sure absolutely nothing before the header() function is
> outputing anything. No echos, no prints, no var_dumps, no HTML or even blank
> lines.
>
> If it's something tangible like an echo or print or something, then
> putting an exit()/die() function right before the header() function then
> looking at the HTML source that you get should show you what the offending
> output is.
>
> But again, if I recall, it can be something as simple as an empty line.
>
> -
> 
> // This should work because there's no output or white space above
> header()
> header('Location: thanks.php');
>
> ?>
> -
>
> -
>
> 
> // This should fail (if I recall) because of the blank line that's sent
> // before the PHP code block. This is considered output, and can't come
> before
> // any header statements
>
> header('Location: thanks.php');
>
> ?>
> -
>
>
> = = = Original message = = =
>
> when I add that code I can the following error msg when submitting the
> form.
> " *Warning*: Cannot modify header information - headers already sent by
> (output started at /home/webadmin/dedicated75.virtual.vps-
> host.net/html/fortuneInteractive/Consultation_test.php:6
> )
> in */home/webadmin/dedicated75.virtual.vps-
> host.net/html/fortuneInteractive/Consultation_test.php
> 
> * on line *168* "
> line 168 is the one with header( 'Location: thanks.php' );
> on it.
> can anyone explain why this is happening and how to rectify?
> TIA
>
> On 10/5/05, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >
> > On Wed, 2005-10-05 at 21:15, Bruce Gilbert wrote:
> > > thanks for the reply.
> > >
> > > and where on the page would that need to go? Within the head tags?
> > > and would it need to be within 
> >
> > Right after this line:
> >
> > mail ($to, $subject, $msg, $mailheaders);
> >
> > And you will already be within PHP interpretation.
> >
> > Cheers,
> > Rob.
> > --
> > ..
> > | InterJinn Application Framework - http://www.interjinn.com |
> > ::
> > | An application and templating framework for PHP. Boasting |
> > | a powerful, scalable system for accessing system services |
> > | such as forms, properties, sessions, and caches. InterJinn |
> > | also provides an extremely flexible architecture for |
> > | creating re-usable components quickly and easily. |
> > `'
> >
> >
>
>
> --
> ::Bruce::
>
>
> ___
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
>
>


--
::Bruce::


Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-06 Thread tg-php
Check to make sure absolutely nothing before the header() function is outputing 
anything.  No echos, no prints, no var_dumps, no HTML or even blank lines.

If it's something tangible like an echo or print or something, then putting an 
exit()/die() function right before the header() function then looking at the 
HTML source that you get should show you what the offending output is.

But again, if I recall, it can be something as simple as an empty line.

-

-

-


-


= = = Original message = = =

when I add that code I can the following error msg when submitting the form.
 " *Warning*: Cannot modify header information - headers already sent by
(output started at /home/webadmin/dedicated75.virtual.vps-
host.net/html/fortuneInteractive/Consultation_test.php:6)
in */home/webadmin/dedicated75.virtual.vps-
host.net/html/fortuneInteractive/Consultation_test.php
* on line *168* "
 line 168 is the one with header( 'Location: thanks.php' );
on it.
 can anyone explain why this is happening and how to rectify?
 TIA

 On 10/5/05, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> On Wed, 2005-10-05 at 21:15, Bruce Gilbert wrote:
> > thanks for the reply.
> >
> > and where on the page would that need to go? Within the head tags?
> > and would it need to be within 
>
> Right after this line:
>
> mail ($to, $subject, $msg, $mailheaders);
>
> And you will already be within PHP interpretation.
>
> Cheers,
> Rob.
> --
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `'
>
>


--
::Bruce::


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-06 Thread Bruce Gilbert
when I add that code I can the following error msg when submitting the form.
 " *Warning*: Cannot modify header information - headers already sent by
(output started at /home/webadmin/dedicated75.virtual.vps-
host.net/html/fortuneInteractive/Consultation_test.php:6)
in */home/webadmin/dedicated75.virtual.vps-
host.net/html/fortuneInteractive/Consultation_test.php
* on line *168* "
 line 168 is the one with header( 'Location: thanks.php' );
on it.
 can anyone explain why this is happening and how to rectify?
 TIA

 On 10/5/05, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> On Wed, 2005-10-05 at 21:15, Bruce Gilbert wrote:
> > thanks for the reply.
> >
> > and where on the page would that need to go? Within the head tags?
> > and would it need to be within 
>
> Right after this line:
>
> mail ($to, $subject, $msg, $mailheaders);
>
> And you will already be within PHP interpretation.
>
> Cheers,
> Rob.
> --
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `'
>
>


--
::Bruce::


Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-05 Thread Robert Cummings
On Wed, 2005-10-05 at 21:15, Bruce Gilbert wrote:
> thanks for the reply.
> 
>  and where on the page would that need to go? Within the head tags?
> and would it need to be within 

Right after this line:

mail ($to, $subject, $msg, $mailheaders);

And you will already be within PHP interpretation.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php