Connecting Tech Pros Worldwide Help | Site Map

Page Last Updated Syntax error

Richard
Guest
 
Posts: n/a
#1: Oct 18 '07
I tried embedding this in an XHTML file, then changed it to a
last4.php, but get a syntax error. What am I doing wrong?


<?php
$last_modified = filemtime("last4.php");
print("Page Last Updated: ");
print(date("m/j/y h:i", $last_modified));
?>

Michael Fesser
Guest
 
Posts: n/a
#2: Oct 18 '07

re: Page Last Updated Syntax error


..oO(Richard)
Quote:
>I tried embedding this in an XHTML file, then changed it to a
>last4.php, but get a syntax error. What am I doing wrong?
What syntax error and where?
Quote:
><?php
>$last_modified = filemtime("last4.php");
>print("Page Last Updated: ");
>print(date("m/j/y h:i", $last_modified));
>?>
'print' doesn't require parentheses, it's not a function.

Micha
nithin
Guest
 
Posts: n/a
#3: Oct 18 '07

re: Page Last Updated Syntax error


On Oct 18, 4:41 am, Richard <richardvan...@sbcglobal.netwrote:
Quote:
I tried embedding this in an XHTML file, then changed it to a
last4.php, but get a syntax error. What am I doing wrong?
>
<?php
$last_modified = filemtime("last4.php");
print("Page Last Updated: ");
print(date("m/j/y h:i", $last_modified));
?>
This code is working for me

Captain Paralytic
Guest
 
Posts: n/a
#4: Oct 18 '07

re: Page Last Updated Syntax error


On 18 Oct, 00:41, Richard <richardvan...@sbcglobal.netwrote:
Quote:
but get a syntax error.
What am I doing wrong?
What you are doing wrong is not thinking before you post.

You tell us that you are getting a syntax error, but don't bother to
tell us what the error actually says!


AnrDaemon
Guest
 
Posts: n/a
#5: Oct 21 '07

re: Page Last Updated Syntax error


Greetings, Michael Fesser.
In reply to Your message dated Thursday, October 18, 2007, 05:42:00,

MF'print' doesn't require parentheses, it's not a function.

But it is a good idea to use them IMHO. Code looks much more solid for me.


--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>

Michael Fesser
Guest
 
Posts: n/a
#6: Oct 21 '07

re: Page Last Updated Syntax error


..oO(AnrDaemon)
Quote:
>Greetings, Michael Fesser.
>In reply to Your message dated Thursday, October 18, 2007, 05:42:00,
>
>MF'print' doesn't require parentheses, it's not a function.
>
>But it is a good idea to use them IMHO.
Not always. Take 'echo' for example: Of course you can also use it with
parentheses, but it not always behaves like a function and if you want
to pass multiple strings to it, parentheses can't be used at all.

Micha

PS: Could you please ajust your newsreader to start quoted lines with
just a '>'? That's the common way on Usenet and that's how all news-
readers detect quoted lines to display them differently for example.
Closed Thread