RE: [PHP] strange php output

2002-07-10 Thread César Aracena

I don't understand quite well your question, but I guess you are trying
to include a page inside other pages containing just a script that shows
up the actual Date and Time... Well, you could simplify this just by
making a finction called i.e. datetime() and call it from wherever you
want.

It that's the case, do this in other page or inside any of your pages
(i.e. main.php):

function datetime()
{
echo date (D, jS F Y \a\t G:i:s);
}

This code is UNTESTED... I forgot if I have to put a backslash (\)
before the : in the time part ;)

Hope this helps,

C.

 -Original Message-
 From: Calvin Spealman [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 10, 2002 5:27 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] strange php output
 
 I'm trying to do a little trick with my new site.  i have one main php
 script, index.php which includes the header and footer scripts and the
 page script between them.  the page script is determined by $page,
which
 is set to main if it doesnt exist already.  $page . .php is then
 included.  I have one other page so far, datetime.php.  I wanted to
 let datatime run itself by including the headers and footers on its
own
 if it wasnt included by index.php.  so, i add this to the top and
 similar code at the bottom (replaced header with footer):
 
 ?
   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 htmlbody/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?
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] strange php output

2002-07-10 Thread Alberto Serra

ðÒÉ×ÅÔ!

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 htmlbody/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...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php