![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| // 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 | |||
| Advertisements |
| | #2 | ||
| On Fri, 15 Aug 2003 16:56:58 -0400 in <message-id:NOb%a.2803$3M4.744@lakeread04> "Phil Powell" <soazine@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. | |||
| | #3 | ||
| 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]" <ian@WINDOZEdigiserv.net> wrote in message news:20030815220719.23d18bc8.ian@WINDOZEdigiserv.n et... > On Fri, 15 Aug 2003 16:56:58 -0400 in > <message-id:NOb%a.2803$3M4.744@lakeread04> > "Phil Powell" <soazine@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. | |||
| | #4 | ||
| On Fri, 15 Aug 2003 17:15:06 -0400 in <message-id 3c%a.2918$3M4.1040@lakeread04>"Phil Powell" <soazine@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. | |||
| | #5 | ||
| 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. | |||
| Featured Websites | ||||
|
![]() |
| Tags: header, warnings |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| header location problem | march | PHP | 2 | 07-01-2007 4:17 PM |
| PHP default header information | Todd Beauchemin | PHP | 1 | 07-01-2007 4:12 PM |
| php header for images | Ian.H [dS] | PHP | 0 | 07-01-2007 3:58 PM |
| Firewire bracket header thingy...? | Tin-Char D'un | Central Processing Unit (CPU) and Overclocking | 0 | 06-17-2007 9:39 PM |
| Serial Port Header? | Tom Lake | Motherboards | 1 | 06-11-2007 1:09 PM |
| Featured Websites | ||||
|