Re: strange php output
| From: | Alberto Serra | Date: | Wed, 10 Jul 2002 08:36:17 +0000 |
| Subject: | Re: strange php output | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-106715@lists.php.net to get a copy of this message | ||
Привет!
Calvin Spealman wrote:
<?
if (!$page=="datetime") // Not using index.php
{
include("header.php");
}
?>
this code works when datetime.php is included by index.php, but on its own the script just outputs <html><body></body></html>. Even ignoring the xhtml code outside the php code in the file. its like the entire file is ignored. i really have no clue why. anyone else have one?
Before using a variable (in a comparison or wherever) you should make sure it *does* exist.
try
if (isset($page) && !($page=="datetime")) // Not using index.php
{
include("header.php");
}
пока
Альберто
Киев
@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@
LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is.......