For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > August 2005 > PHP header() function









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP header() function
mail1_fr

2005-08-04, 5:01 pm

Hi,

I have 2 questions :

1 - How to launch a sheet S2 from a sheet S1 ?
------------------------------------------------

We have to is the header() function or do there is something else ? Like
"Run S2" ?

header("Location:../users/admin.php"); ??



2 - What is the exact functionality of header() and how ton use it ?
------------------------------------------------------------------

I get this error :

Warning: Cannot modify header information - headers already sent by (output
started at c:\program
files\easyphp1- 8\www\essaisphp\essais\essai1\connection
\connection_site.php:
14) in c:\program
files\easyphp1- 8\www\essaisphp\essais\essai1\connection
\connection_site.php
on line 40


Thank you.

R





Tony

2005-08-04, 5:01 pm

"mail1_fr" <mail1_fr@yahoo.fr> wrote in message
news:42f22579$0$32367$636a15ce@news.free.fr...
>
> 2 - What is the exact functionality of header() and how ton use it ?
> ------------------------------------------------------------------
>
> I get this error :
>
> Warning: Cannot modify header information - headers already sent by
> (output
> started at c:\program
> files\easyphp1- 8\www\essaisphp\essais\essai1\connection
\connection_site.php:
> 14) in c:\program
> files\easyphp1- 8\www\essaisphp\essais\essai1\connection
\connection_site.php
> on line 40


You have to call header() before there is any output. It appears that there
is output at line 14, and you are calling header() at line 40, if I'm
reading the error right.



ZeldorBlat

2005-08-04, 5:01 pm

>2 - What is the exact functionality of header() and how ton use it ?

Take a look at this:
http://www.php.net/manual/en/function.header.php

Bas Varkevisser

2005-08-06, 8:59 am

This goes wrong when your hosting party uses Microsoft IIS as webserver.
Apache handles this ok (this lets you send headers at any time, IIS
doesn't).
There is a PHP function that lets you buffer all output before its sent to
the webserver.
I believe the ob_start can help you.

Bas.


"mail1_fr" <mail1_fr@yahoo.fr> wrote in message
news:42f22579$0$32367$636a15ce@news.free.fr...
> Hi,
>
> I have 2 questions :
>
> 1 - How to launch a sheet S2 from a sheet S1 ?
> ------------------------------------------------
>
> We have to is the header() function or do there is something else ? Like
> "Run S2" ?
>
> header("Location:../users/admin.php"); ??
>
>
>
> 2 - What is the exact functionality of header() and how ton use it ?
> ------------------------------------------------------------------
>
> I get this error :
>
> Warning: Cannot modify header information - headers already sent by
> (output
> started at c:\program
> files\easyphp1- 8\www\essaisphp\essais\essai1\connection
\connection_site.php:
> 14) in c:\program
> files\easyphp1- 8\www\essaisphp\essais\essai1\connection
\connection_site.php
> on line 40
>
>
> Thank you.
>
> R
>
>
>
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com