RE: [PHP] Include vs. Header
| From: | InfoSpace Inc) | Date: | Fri, 06 Oct 2000 23:59:34 +0000 |
| Subject: | RE: [PHP] Include vs. Header | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19009@lists.php.net to get a copy of this message | ||
Thank you so much for your reply. Will there be any restrictions to call
cookie function if I use include(), since cookie function requires no header
info passed prior to calling it...
> -----Original Message-----
> From: Matt McClanahan [mailto:cardinal@dodds.net]
> Sent: Friday, October 06, 2000 4:56 PM
> To: Eugene Yi (InfoSpace Inc)
> Cc: 'php-general@lists.php.net'
> Subject: Re: [PHP] Include vs. Header
>
>
> On Fri, 6 Oct 2000, Eugene Yi (InfoSpace Inc) wrote:
>
> > Hi, guys!
> > I'd wanna ask you a trivial question and I don't have a
> firm idea even after
> > referencing to the php.net's doc. I basically want to know
> the differences
> > and usages of include() and header() (and require()). When
> I was working
> > with PHP 2.x, I always (and only) used include() & exit()
> combi to move on
> > to the next page. It feels like I have some limitation
> when doing so in PHP
> > 4. Is that true especially when I introduce the cookie
> function, or am I
> > just dreaming?
>
> PHP still uses include and require to include content in a
> page, just as
> you were doing in your example. Header() is used for a
> different purpose,
> to send HTTP Header information. One of those headers,
> Location, simply
> redirects the browser to a new location. You don't return from it,
> because it's sent to the browser before any normal content.
>
> As a side note, exit() isn't really necessary in the include files.
>
> Matt
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>