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

Header warnings??? Why??

P: n/a
// REDIRECT THEM BACK TO LOGIN
if ($hasSubmittedUsername) {
header("Location: http://$SERVER_NAME/fslogin.php?errorMsg=" .
urlencode($font . '<font color=000099><li>Password
emailed</li></font></font><p>') .
'&username=' . urlencode($username));
}

?>

<html>
<head>
<title><?= $brand ?> Login: Forgot Password</title>

Based on this code snippet (and there is nothing being written to the
headers prior to header("Location.."), why am I getting the following:

Warning: Cannot add header information - headers already sent by (output
started at /home/youth/finesocceryouthsessions-www/fsforgot.php:15) in
/home/youth/finesocceryouthsessions-www/fsforgot.php on line 114

The line is the header() line. Furthermore, instead of being redirected to
fslogin.php I am still at fsforgot.php! Can someone help me quickly, I'm on
a tight deadline!

Thanx
Phil
Jul 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Fri, 15 Aug 2003 16:56:58 -0400 in
<message-id:NOb%a.2803$3M4.744@lakeread04>
"Phil Powell" <so*****@erols.com> wrote:
// REDIRECT THEM BACK TO LOGIN
if ($hasSubmittedUsername) {
header("Location: http://$SERVER_NAME/fslogin.php?errorMsg=" .
urlencode($font . '<font color=000099><li>Password
emailed</li></font></font><p>') .
'&username=' . urlencode($username));
}

?>

<html>
<head>
<title><?= $brand ?> Login: Forgot Password</title>

Based on this code snippet (and there is nothing being written to the
headers prior to header("Location.."), why am I getting the following:

Warning: Cannot add header information - headers already sent by
(output started at
/home/youth/finesocceryouthsessions-www/fsforgot.php:15)
in/home/youth/finesocceryouthsessions-www/fsforgot.php on line 114

The line is the header() line. Furthermore, instead of being
redirected to fslogin.php I am still at fsforgot.php! Can someone
help me quickly, I'm on a tight deadline!

Thanx
Phil

Complete stab in the dark Phil.. is your <?php line on the very first
line of the script? any blanks before that constitutes as data sent as
the body.

As for the other part, are register_globals enabled? Could try:
$_SERVER['SERVER_NAME']

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.
Jul 16 '05 #2

P: n/a
I am now the official idiot of the group.

The very first line of the script is <?php

However, this is how it was formatted:

<?php

// COMMENTS

?>

<?
// ACTUAL SCRIPT including "header"

?>

Notice the space between the <? ?> blocks?

Phil
"Ian.H [dS]" <ia*@WINDOZEdigiserv.net> wrote in message
news:20030815220719.23d18bc8.ia*@WINDOZEdigiserv.n et...
On Fri, 15 Aug 2003 16:56:58 -0400 in
<message-id:NOb%a.2803$3M4.744@lakeread04>
"Phil Powell" <so*****@erols.com> wrote:
// REDIRECT THEM BACK TO LOGIN
if ($hasSubmittedUsername) {
header("Location: http://$SERVER_NAME/fslogin.php?errorMsg=" .
urlencode($font . '<font color=000099><li>Password
emailed</li></font></font><p>') .
'&username=' . urlencode($username));
}

?>

<html>
<head>
<title><?= $brand ?> Login: Forgot Password</title>

Based on this code snippet (and there is nothing being written to the
headers prior to header("Location.."), why am I getting the following:

Warning: Cannot add header information - headers already sent by
(output started at
/home/youth/finesocceryouthsessions-www/fsforgot.php:15)
in/home/youth/finesocceryouthsessions-www/fsforgot.php on line 114

The line is the header() line. Furthermore, instead of being
redirected to fslogin.php I am still at fsforgot.php! Can someone
help me quickly, I'm on a tight deadline!

Thanx
Phil

Complete stab in the dark Phil.. is your <?php line on the very first
line of the script? any blanks before that constitutes as data sent as
the body.

As for the other part, are register_globals enabled? Could try:
$_SERVER['SERVER_NAME']

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 16 '05 #3

P: n/a
On Fri, 15 Aug 2003 17:15:06 -0400 in
<message-id:O3c%a.2918$3M4.1040@lakeread04>
"Phil Powell" <so*****@erols.com> wrote:
I am now the official idiot of the group.

The very first line of the script is <?php

However, this is how it was formatted:

<?php

// COMMENTS

?>

<?
// ACTUAL SCRIPT including "header"

?>

Notice the space between the <? ?> blocks?

Heh.. it happens Phil.

A while back, I posted a snippet of code here, claiming that further up
in the script (also pasted into the post) was identical to the part that
wasn't working.... I forget who now, but it was pointed out I had missed
a , or ; or something "silly"... but needless to say, the 2 snippets
weren't quite as identical as I thought, lol.

You also stated you're on a tight deadline.. this won't help as you'll
have a tendency to overlook the more "silly / trivial" things, and
probably look for a more complex problem that doesn't actually exist
(yup, done that many a time too ;) ).

Hope all's goin' well fr you now and you hit your deadline =)

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.
Jul 16 '05 #4

P: n/a
Phil Powell wrote:>>
// REDIRECT THEM BACK TO LOGIN
if ($hasSubmittedUsername) {
header("Location: http://$SERVER_NAME/fslogin.php?errorMsg=" .
urlencode($font . '<font color=000099><li>Password
emailed</li></font></font><p>') .
'&username=' . urlencode($username));
} ?> <html>
<head>
<title><?= $brand ?> Login: Forgot Password</title> Based on this code snippet (and there is nothing being written to the
headers prior to header("Location.."), why am I getting the following: Warning: Cannot add header information - headers already sent by (output
started at /home/youth/finesocceryouthsessions-www/fsforgot.php:15) in
/home/youth/finesocceryouthsessions-www/fsforgot.php on line 114 The line is the header() line. Furthermore, instead of being redirected
to fslogin.php I am still at fsforgot.php! Can someone help me quickly,
I'm on a tight deadline! Thanx
Phil


Might have a nested tag open somewhere.
I was encountering a similar problem with some coding and when I had enough
close tags, the error went away.
The process continues working it's way down the ladder until it receives an
end point.
If no end point is reached and it passes through more coding, you get the
error.
Which happens a lot in javascript when you have script below the body of the
html. The process runs over into the lower coding and encounters the error.

Jul 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.