470,849 Members | 1,361 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Where Does Date Code Go 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");
Jul 19 '05 #1
4 2387
Stupidgirl wrote:
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.


Try this. And only this in a webpage:

<?php
echo "Hello world!";
?>

If that prints out the word "echo" or it doesn't print out

Hello world!

your php isn't working correctly and you need to fix that before trying
to do anything else with it.

I think it is broken because you said that it prints out text like this:

echo("The Time Is $now");

Jul 19 '05 #2
Stupidgirl wrote:
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.


Try this. And only this in a webpage:

<?php
echo "Hello world!";
?>

If that prints out the word "echo" or it doesn't print out

Hello world!

your php isn't working correctly and you need to fix that before trying
to do anything else with it.

I think it is broken because you said that it prints out text like this:

echo("The Time Is $now");

Jul 19 '05 #3
Aggro <sp**********@yahoo.com> wrote in message news:<YN************@read3.inet.fi>...

Try this. And only this in a webpage:

<?php
echo "Hello world!";
?>

If that prints out the word "echo" or it doesn't print out

Hello world!

your php isn't working correctly and you need to fix that before trying
to do anything else with it.

I think it is broken because you said that it prints out text like this:

echo("The Time Is $now");

Problem solved, like my 'master', i am new to all this. He pointed out
that i needed seperate <?php & ?> brackets for each 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.
Jul 19 '05 #4
Aggro <sp**********@yahoo.com> wrote in message news:<YN************@read3.inet.fi>...

Try this. And only this in a webpage:

<?php
echo "Hello world!";
?>

If that prints out the word "echo" or it doesn't print out

Hello world!

your php isn't working correctly and you need to fix that before trying
to do anything else with it.

I think it is broken because you said that it prints out text like this:

echo("The Time Is $now");

Problem solved, like my 'master', i am new to all this. He pointed out
that i needed seperate <?php & ?> brackets for each 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.
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Stupidgirl | last post: by
2 posts views Thread by Paul Beckett | last post: by
reply views Thread by Stupidgirl | last post: by
1 post views Thread by James Radke | last post: by
5 posts views Thread by Martin Eyles | last post: by
3 posts views Thread by mantrid | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.