Re: Where Do I Place Date Code for Webpage Display
I noticed that Message-ID:
<30d56be7.03111 80959.2c9b2605@ posting.google. com> from Stupidgirl
contained the following:
[color=blue]
>Problem solved, like my 'master', i am new to all this. He pointed out
>that i should try separate <?php & ?> brackets for each piece of code
>on the page. I had only included the one pair. Presuming that all code
>within it would be processed.[/color]
Well it will, as long as the only thing within the tag is code. One of
the really cool things is that you can make non code, conditional.
<?php
if(condition){
?>
Some html that shows if condition is true
<?php }
else{ ?>
Some html that only shows if the condition is false
<?php } ?>
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Where Do I Place Date Code for Webpage Display
Collapse
This topic is closed.
X
X
-
Guest replied -
Guest repliedRe: Where Do I Place Date Code for Webpage Display
nc@iname.com (Nikolai Chuvakhin) wrote in message news:<32d7a63c. 0311151808.5140 f68b@posting.go ogle.com>...[color=blue][color=green]
> > The following are my failures;
> >
> > Today's Date Is <?php echo gmdate("D M d Y"); ?>[/color]
>
> This must work if PHP is supported...
>
> Cheers,
> NC[/color]
Problem solved, like my 'master', i am new to all this. He pointed out
that i should try separate <?php & ?> brackets for each piece of code
on the page. I had only included the one pair. Presuming that all code
within it would be processed. Thanks anyway. It seems to be doing the
job.
Leave a comment:
-
Guest repliedRe: Where Do I Place Date Code for Webpage Display
webmistress@man chesterpaul.net (Stupidgirl) wrote in message
news:<30d56be7. 0311151122.1130 495c@posting.go ogle.com>...[color=blue]
>
> Hi, i have had no problem displaying the current date and time, on a
> static webpage. However, when i try to use the various PHP and MySQL
> snippets, it does'nt seem to work out.[/color]
First of all, are you sure you server even supports PHP and MySQL?
If it does, does your script file have the *.php extension?
[color=blue]
> The following are my failures;
>
> Today's Date Is <?php echo gmdate("D M d Y"); ?>[/color]
This must work if PHP is supported...
Cheers,
NC
Leave a comment:
-
Guest repliedRe: Where Do I Place Date Code for Webpage Display
In article <30d56be7.03111 51122.1130495c@ posting.google. com>,
webmistress@man chesterpaul.net (Stupidgirl) wrote:
:Today's Date Is <?php
:$today =date("l, d, F, Y");
:$now = date("H:i:s");< br>
:echo("Today Is $today");<br>
:echo("The Time Is $now");
Today's Date Is <?php echo gmdate("D M d Y H:i:s"). "<br />"; ?>
<?php
$today = date("l, d, F, Y");
$now = date("H:i:s");
echo "Today Is " . $today . "<br />";
echo "The Time Is" . $now;
?>
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.
Leave a comment:
-
Where Do I Place Date Code for Webpage Display
Hi, i have had no problem displaying the current date and time, on a
static webpage. However, when i try to use the various PHP and MySQL
snippets, it does'nt seem to work out.
My success story can be seen on, amongst others,
http:www.manchesterpaul.net/world.war.html
http:www.manchesterpaul.net/world.govroy.html
For this i used the Server Side Includes code of
<!--#echo var="DATE_GMT" -->~~~If this is not today's date, refresh
page for updated version.
I have tried placing the above AND the MySQL, PHP versions detailed
below, on the PHP outputted webpages, above and below the PHP
sections. Also, within the Database Fields, as an entry. In the same
way that one uses HTML code in the displayed results from a PHP query.
Instead of the date and time i get lots of similar output to the bit
below,
#######
Today's Date Is
Today's Date Is Today's Date Is echo("Today Is $today");
echo("The Time Is $now");
#######
Can someone enlighten me as to where the code should be placed. Under
no circumstances do i wish to use Javascript.
The following are my failures;
Today's Date Is <?php echo gmdate("D M d Y"); ?>
Today's Date Is <?php
$today =date("l, d, F, Y");
$now = date("H:i:s");< br>
echo("Today Is $today");<br>
echo("The Time Is $now");
Tags: None
Leave a comment: