Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Success covers a multitude of blunders." -- George Bernard Shaw


devel / comp.lang.php / Newbie needs recommendation for fast learning a little php.

SubjectAuthor
* Newbie needs recommendation for fast learning a little php.Not even a newbie
+* Re: Newbie needs recommendation for fast learning a little php.J.O. Aho
|`- Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
+* Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
|+* Re: Newbie needs recommendation for fast learning a little php.Arno Welzel
||`* Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
|| `- Re: Newbie needs recommendation for fast learning a little php.Arno Welzel
|`* Re: Newbie needs recommendation for fast learning a little php.J.O. Aho
| `* Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
|  +* Re: Newbie needs recommendation for fast learning a little php.J.O. Aho
|  |`* Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
|  | +- Re: Newbie needs recommendation for fast learning a little php.J.O. Aho
|  | +* Re: Newbie needs recommendation for fast learning a little php.Arno Welzel
|  | |`* Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
|  | | +* Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
|  | | |`* Re: Newbie needs recommendation for fast learning a little php.John-Paul Stewart
|  | | | `- Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
|  | | `* Re: Newbie needs recommendation for fast learning a little php.Arno Welzel
|  | |  +- Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
|  | |  `- Re: Newbie needs recommendation for fast learning a little php.Mi Na
|  | `* Re: Newbie needs recommendation for fast learning a little php.Pierre Jelenc
|  |  `* Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
|  |   `- Re: Newbie needs recommendation for fast learning a little php.Pierre Jelenc
|  `- Re: Newbie needs recommendation for fast learning a little php.Arno Welzel
+* Re: Newbie needs recommendation for fast learning a little php.Ray_Net
|`- Re: Newbie needs recommendation for fast learning a little php.Not even a newbie
`- Re:Newbie needs recommendation for fast learning a little php.Blue Hat

Pages:12
Newbie needs recommendation for fast learning a little php.

<rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=259&group=comp.lang.php#259

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc3.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx38.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Newbie needs recommendation for fast learning a little php.
Message-ID: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 16
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Tue, 29 Jun 2021 14:30:36 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Tue, 29 Jun 2021 10:30:35 -0400
X-Received-Bytes: 1540
 by: Not_even_a_newbie@example.net - Tue, 29 Jun 2021 14:30 UTC

I don't even know if I'm up to the level of being a newbie at this
point. I mostly need to do a specific thing, get a html file to
display its last modified date and time inside itself.

I'm not sure a book is going to be that useful, but maybe a Web site
could be. I'd need one that really is basic.

I've found a Web page or two, but they seem to assume that I know more
than I do because I can't get the code snippets I've found on those
Web pages to work.

I used to use ssi for this, but I moved to a new Web host and they
seem to have their server time zone set as the only time zone I can
display, and they are far away from me, so in ssi I get a date and
time for a file modification time that's many hours off. I'm hoping
that php will solve my problem. Thanks in advance.

Re: Newbie needs recommendation for fast learning a little php.

<ik1915Fh66nU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=260&group=comp.lang.php#260

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: user@example.net (J.O. Aho)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Tue, 29 Jun 2021 21:01:57 +0200
Lines: 32
Message-ID: <ik1915Fh66nU1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net a4fxDWqlP78P/guNgQ85AAKmBKlJU5MFwXlNePyX7YP1/1mg3d
Cancel-Lock: sha1:tcmT1ggnYGaPr5O6U1Wqi8nEQdA=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
In-Reply-To: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
Content-Language: en-US-large
 by: J.O. Aho - Tue, 29 Jun 2021 19:01 UTC

On 29/06/2021 16.30, Not_even_a_newbie@example.net wrote:
> I mostly need to do a specific thing, get a file to
> display its last modified date and time inside itself.
>
> I used to use ssi for this, but I moved to a new Web host and they
> seem to have their server time zone set as the only time zone I can
> display, and they are far away from me, so in ssi I get a date and
> time for a file modification time that's many hours off.

I'm assuming you got the PHP code to work to show the date (even if it's
the wrong timezone for you).

If you have stored the date in a variable $lastmodified then you could
use the following code to adjust it:

$date = date_create($lastmodified, timezone_open('Pacific/Nauru'));
echo date_format($date, 'Y-m-d H:i:sP');

Just use a valid timezone name to replace the Pacific/Nauru. Keep in
mind that the time may look off for other users who do not live in the
timezone you want to display.

For more information about datetime and timezone check the following
page at php.net:

https://www.php.net/manual/en/datetime.settimezone.php

--

//Aho

Re: Newbie needs recommendation for fast learning a little php.

<aoeodg9j5nph9k1v6sk02eq2n8lusil4g5@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=261&group=comp.lang.php#261

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!peer01.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx43.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <aoeodg9j5nph9k1v6sk02eq2n8lusil4g5@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <ik1915Fh66nU1@mid.individual.net>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 57
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Wed, 30 Jun 2021 09:58:22 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Wed, 30 Jun 2021 05:58:22 -0400
X-Received-Bytes: 3012
 by: Not_even_a_newbie@example.net - Wed, 30 Jun 2021 09:58 UTC

On Tue, 29 Jun 2021 21:01:57 +0200, "J.O. Aho" <user@example.net>
wrote:

>
>On 29/06/2021 16.30, Not_even_a_newbie@example.net wrote:
>> I mostly need to do a specific thing, get a file to
>> display its last modified date and time inside itself.
> >
>> I used to use ssi for this, but I moved to a new Web host and they
>> seem to have their server time zone set as the only time zone I can
>> display, and they are far away from me, so in ssi I get a date and
>> time for a file modification time that's many hours off.
>
>I'm assuming you got the PHP code to work to show the date (even if it's
>the wrong timezone for you).

Yeah, I think.

I used this code:

<p>Date/Time: YYYY-MM-DD hh:mm<br>
<?php echo(strftime("%Y-%m-%d %H:%M")); ?></p>

and it produced this output:

Date/Time: YYYY-MM-DD hh:mm
2021-06-30 05:38

So the above output is the format I want, and it is in my time zone. I
was able to make it so that PHP uses my time zone, even though the
server is far away. What I'll want is the actual date/time string, and
I figure that I can cut out the other part that's before it.

I've been spending a lot of time trying to figure this all out. Right
now I'm thinking that using something like "filemtime" is going to
give me what I want. So far I am not having any luck with it though.

What I need to do is get the PHP script, when I can hammer it out,
into a HTML file and have the file display its own modification time.

>If you have stored the date in a variable $lastmodified then you could
>use the following code to adjust it:
>
>$date = date_create($lastmodified, timezone_open('Pacific/Nauru'));
>echo date_format($date, 'Y-m-d H:i:sP');
>
>Just use a valid timezone name to replace the Pacific/Nauru. Keep in
>mind that the time may look off for other users who do not live in the
>timezone you want to display.
>
>For more information about datetime and timezone check the following
>page at php.net:
>
>https://www.php.net/manual/en/datetime.settimezone.php

Yes, I've looked at that and I have the server using my time zone for
PHP output. Thanks for that and thanks for replying.

Re: Newbie needs recommendation for fast learning a little php.

<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=262&group=comp.lang.php#262

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx43.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 14
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Wed, 30 Jun 2021 12:08:05 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Wed, 30 Jun 2021 08:08:04 -0400
X-Received-Bytes: 1210
 by: Not_even_a_newbie@example.net - Wed, 30 Jun 2021 12:08 UTC

This does what I want, but only as a .PHP file. How do I get it into a
file named foo.html so I can have foo.html declare when it was last
modified?

<?php
$file = $_SERVER["SCRIPT_NAME"];
$break = Explode('/', $file);
$pfile = $break[count($break) - 1];
//echo $pfile;
echo "This file was last modified on: " .date("Y-m-d
H:m",filemtime($pfile));
?>

I feel as if I'm almost there.

Re: Newbie needs recommendation for fast learning a little php.

<ik38p4Fsqc5U1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=263&group=comp.lang.php#263

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@arnowelzel.de (Arno Welzel)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Wed, 30 Jun 2021 15:09:57 +0200
Lines: 39
Message-ID: <ik38p4Fsqc5U1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net wdNJPz0GLqkGN0RAZfowAwTbps2w1DyCl5ytSDxoPMU0S+wNur
Cancel-Lock: sha1:VRrpvQj9MpWJB6mzvWF6w/LSEwQ=
In-Reply-To: <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
 by: Arno Welzel - Wed, 30 Jun 2021 13:09 UTC

Not_even_a_newbie@example.net:

> This does what I want, but only as a .PHP file. How do I get it into a
> file named foo.html so I can have foo.html declare when it was last
> modified?
>
> <?php
> $file = $_SERVER["SCRIPT_NAME"];
> $break = Explode('/', $file);
> $pfile = $break[count($break) - 1];

Why this?

> //echo $pfile;
> echo "This file was last modified on: " .date("Y-m-d
> H:m",filemtime($pfile));
> ?>
>
> I feel as if I'm almost there.

Much simpler:

<?php
echo "This file was last modified on: ";
echo date("Y-m-d H:m",filemtime($_SERVER["SCRIPT_FILENAME"]));
?>

Also see:

<https://www.php.net/manual/en/reserved.variables.server.php>

"'SCRIPT_FILENAME'

The absolute pathname of the currently executing script."

--
Arno Welzel
https://arnowelzel.de

Re: Newbie needs recommendation for fast learning a little php.

<ik3d56Fti4nU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=264&group=comp.lang.php#264

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: user@example.net (J.O. Aho)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Wed, 30 Jun 2021 16:24:38 +0200
Lines: 31
Message-ID: <ik3d56Fti4nU1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net Htmu8xDjRMQvNIxangitIg8/+vicz/vlEnSf4dMybhY2F0n2Pk
Cancel-Lock: sha1:q22WYSLdbgeFgWLokWLSW7cpHf8=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
In-Reply-To: <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
Content-Language: en-US-large
 by: J.O. Aho - Wed, 30 Jun 2021 14:24 UTC

On 30/06/2021 14.08, Not_even_a_newbie@example.net wrote:
> This does what I want, but only as a .PHP file. How do I get it into a
> file named foo.html so I can have foo.html declare when it was last
> modified?
>
> <?php
> $file = $_SERVER["SCRIPT_NAME"];
> $break = Explode('/', $file);
> $pfile = $break[count($break) - 1];
> //echo $pfile;
> echo "This file was last modified on: " .date("Y-m-d
> H:m",filemtime($pfile));
> ?>
>
> I feel as if I'm almost there.

I won't comment on the code as Arno already done that, there is two
options, I would say one option is not up to you, so in reality you have
only one option (the last one)

1. Make the webserver to send .html files to tne php engine as it does
with the .php files.

2. Rename the .html file to .php

--

//Aho

Re: Newbie needs recommendation for fast learning a little php.

<ut9pdg5ou2tg89810v9eshhv1p26c1snl2@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=265&group=comp.lang.php#265

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx46.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <ut9pdg5ou2tg89810v9eshhv1p26c1snl2@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com> <ik38p4Fsqc5U1@mid.individual.net>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 52
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Wed, 30 Jun 2021 17:46:36 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Wed, 30 Jun 2021 13:46:35 -0400
X-Received-Bytes: 2533
 by: Not_even_a_newbie@example.net - Wed, 30 Jun 2021 17:46 UTC

On Wed, 30 Jun 2021 15:09:57 +0200, Arno Welzel <usenet@arnowelzel.de>
wrote:

>Not_even_a_newbie@example.net:
>
>> This does what I want, but only as a .PHP file. How do I get it into a
>> file named foo.html so I can have foo.html declare when it was last
>> modified?
>>
>> <?php
>> $file = $_SERVER["SCRIPT_NAME"];
>> $break = Explode('/', $file);
>> $pfile = $break[count($break) - 1];
>
>Why this?

Why the one below here? I'm casting about trying to find something
that works. I'm picking up what I can. I'm pretty much flailing about
at this point.

>> //echo $pfile;
>> echo "This file was last modified on: " .date("Y-m-d
>> H:m",filemtime($pfile));
>> ?>
>>
>> I feel as if I'm almost there.
>
>Much simpler:
>
><?php
>echo "This file was last modified on: ";
>echo date("Y-m-d H:m",filemtime($_SERVER["SCRIPT_FILENAME"]));
>?>

Thanks for that. I've plugged this in and saved it as foo.php and I
get an odd reaction. The actual time stamp on the file is 13:22, but
the above script is telling me that the file was last modified at
13:06. I suppose that the idiots at my Web host may have screwed up
something on the server. The 13:22 time is when I created the file, so
it can't be that it's showing when it was created and not when it was
modified. I'm scratching my head here.

>Also see:
>
><https://www.php.net/manual/en/reserved.variables.server.php>
>
>"'SCRIPT_FILENAME'
>
>The absolute pathname of the currently executing script."

Okay, I don't understand what you mean in the piece immediately above
this. The above url seems to say that the script will just run.

Re: Newbie needs recommendation for fast learning a little php.

<ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=266&group=comp.lang.php#266

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx46.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com> <ik3d56Fti4nU1@mid.individual.net>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 30
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Wed, 30 Jun 2021 17:49:14 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Wed, 30 Jun 2021 13:49:13 -0400
X-Received-Bytes: 1878
 by: Not_even_a_newbie@example.net - Wed, 30 Jun 2021 17:49 UTC

On Wed, 30 Jun 2021 16:24:38 +0200, "J.O. Aho" <user@example.net>
wrote:

>On 30/06/2021 14.08, Not_even_a_newbie@example.net wrote:
>> This does what I want, but only as a .PHP file. How do I get it into a
>> file named foo.html so I can have foo.html declare when it was last
>> modified?
>>
>> <?php
>> $file = $_SERVER["SCRIPT_NAME"];
>> $break = Explode('/', $file);
>> $pfile = $break[count($break) - 1];
>> //echo $pfile;
>> echo "This file was last modified on: " .date("Y-m-d
>> H:m",filemtime($pfile));
>> ?>
>>
>> I feel as if I'm almost there.
>
>I won't comment on the code as Arno already done that, there is two
>options, I would say one option is not up to you, so in reality you have
>only one option (the last one)
>
>1. Make the webserver to send .html files to tne php engine as it does
>with the .php files.
>
>2. Rename the .html file to .php

Uh oh. But I'm reading that I can embed php into a html file. Isn't
that possible?

Re: Newbie needs recommendation for fast learning a little php.

<ik4264F3479U1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=267&group=comp.lang.php#267

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!paganini.bofh.team!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: user@example.net (J.O. Aho)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Wed, 30 Jun 2021 22:23:32 +0200
Lines: 53
Message-ID: <ik4264F3479U1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
<ik3d56Fti4nU1@mid.individual.net>
<ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net g62OcXeWx2VQrhp9Fl1yZgzJ4Zr4qwwJhthGI3M5W2oTl/s8XJ
Cancel-Lock: sha1:076h6kZqUFItv7JMo8kTMzxhwlw=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
In-Reply-To: <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>
Content-Language: en-US-large
 by: J.O. Aho - Wed, 30 Jun 2021 20:23 UTC

On 30/06/2021 19.49, Not_even_a_newbie@example.net wrote:
> On Wed, 30 Jun 2021 16:24:38 +0200, "J.O. Aho" <user@example.net>
> wrote:
>
>> On 30/06/2021 14.08, Not_even_a_newbie@example.net wrote:
>>> This does what I want, but only as a .PHP file. How do I get it into a
>>> file named foo.html so I can have foo.html declare when it was last
>>> modified?
>>>
>>> <?php
>>> $file = $_SERVER["SCRIPT_NAME"];
>>> $break = Explode('/', $file);
>>> $pfile = $break[count($break) - 1];
>>> //echo $pfile;
>>> echo "This file was last modified on: " .date("Y-m-d
>>> H:m",filemtime($pfile));
>>> ?>
>>>
>>> I feel as if I'm almost there.
>>
>> I won't comment on the code as Arno already done that, there is two
>> options, I would say one option is not up to you, so in reality you have
>> only one option (the last one)
>>
>> 1. Make the webserver to send .html files to tne php engine as it does
>> with the .php files.
>>
>> 2. Rename the .html file to .php
>
> Uh oh. But I'm reading that I can embed php into a html file. Isn't
> that possible?

The issue is that the web server will not treat each file it handles as
a php code, it will only look for files that ends with php, send those
to a PHP-engine which parses the file and executes the php code and then
hands back the output to the web server which then sends the output to
the end user (the visitor to your web page).

It's possible to allow .html/.htm files the same way, but then you need
the administration rights of the server, as you are using a shared
service, it means you don't have administrator privileges and those you
can't do the change.

So this leads to the only thing you can do, rename your files so that
they are called .php instead of .html/.htm.

If you don't want to rename files, then you need to look at javascript
solution for displaying last modified document time.

--

//Aho

Re: Newbie needs recommendation for fast learning a little php.

<MPG.3b46fa846ceca8c8989885@news.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=268&group=comp.lang.php#268

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Ray_Net@picarre.be.invalid (Ray_Net)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Wed, 30 Jun 2021 23:03:22 +0200
Organization: iuneequa
Lines: 20
Message-ID: <MPG.3b46fa846ceca8c8989885@news.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net BJmv6VwrfGvS8IdAN3DVAAh1bz+Pi0JyxBaD1VRN0Hy0WbsGo=
Cancel-Lock: sha1:nOXKuDfco3O9eE9/eOHE9aEbjhA=
User-Agent: MicroPlanet-Gravity/3.0.4
 by: Ray_Net - Wed, 30 Jun 2021 21:03 UTC

In article <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>, Not_even_a_newbie@example.net says...
>
> I don't even know if I'm up to the level of being a newbie at this
> point. I mostly need to do a specific thing, get a html file to
> display its last modified date and time inside itself.
>
> I'm not sure a book is going to be that useful, but maybe a Web site
> could be. I'd need one that really is basic.
>
> I've found a Web page or two, but they seem to assume that I know more
> than I do because I can't get the code snippets I've found on those
> Web pages to work.
>
> I used to use ssi for this, but I moved to a new Web host and they
> seem to have their server time zone set as the only time zone I can
> display, and they are far away from me, so in ssi I get a date and
> time for a file modification time that's many hours off. I'm hoping
> that php will solve my problem. Thanks in advance.

https://code.adonline.id.au/last-modified-date-php/

Re: Newbie needs recommendation for fast learning a little php.

<4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=269&group=comp.lang.php#269

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!news-out.netnews.com!news.alt.net!fdc3.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx06.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com> <ik3d56Fti4nU1@mid.individual.net> <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com> <ik4264F3479U1@mid.individual.net>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 95
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Thu, 01 Jul 2021 04:49:58 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Thu, 01 Jul 2021 00:49:58 -0400
X-Received-Bytes: 4411
 by: Not_even_a_newbie@example.net - Thu, 1 Jul 2021 04:49 UTC

On Wed, 30 Jun 2021 22:23:32 +0200, "J.O. Aho" <user@example.net>
wrote:

>
>On 30/06/2021 19.49, Not_even_a_newbie@example.net wrote:
>> On Wed, 30 Jun 2021 16:24:38 +0200, "J.O. Aho" <user@example.net>
>> wrote:
>>
>>> On 30/06/2021 14.08, Not_even_a_newbie@example.net wrote:
>>>> This does what I want, but only as a .PHP file. How do I get it into a
>>>> file named foo.html so I can have foo.html declare when it was last
>>>> modified?
>>>>
>>>> <?php
>>>> $file = $_SERVER["SCRIPT_NAME"];
>>>> $break = Explode('/', $file);
>>>> $pfile = $break[count($break) - 1];
>>>> //echo $pfile;
>>>> echo "This file was last modified on: " .date("Y-m-d
>>>> H:m",filemtime($pfile));
>>>> ?>
>>>>
>>>> I feel as if I'm almost there.
>>>
>>> I won't comment on the code as Arno already done that, there is two
>>> options, I would say one option is not up to you, so in reality you have
>>> only one option (the last one)
>>>
>>> 1. Make the webserver to send .html files to tne php engine as it does
>>> with the .php files.
>>>
>>> 2. Rename the .html file to .php
>>
>> Uh oh. But I'm reading that I can embed php into a html file. Isn't
>> that possible?
>
>The issue is that the web server will not treat each file it handles as
>a php code, it will only look for files that ends with php, send those
>to a PHP-engine which parses the file and executes the php code and then
>hands back the output to the web server which then sends the output to
>the end user (the visitor to your web page).
>
>It's possible to allow .html/.htm files the same way, but then you need
>the administration rights of the server, as you are using a shared
>service, it means you don't have administrator privileges and those you
>can't do the change.

Thanks for clarifying that. I don't control the server, but I've read
that those who do can allow html files to be scanned for php code.
Maybe my Web host has in fact done that. Would I be able to find some
notation about that in the Web host's phpinfo.php file?

Also, some scripts seem to work in html files and some don't.

The following is the entire code for a file I named hello_1.html

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>

It produced the result:

"Hello World

'; ?> "

in the browser. It's obviously got a little problem in the output, but
it did produce a mostly useful output.

Attempts to get the php script I actually want to use to run in an
html file have not, so far, produced the thing the php script tries to
do or else the file doesn't produce any result at all.

>So this leads to the only thing you can do, rename your files so that
>they are called .php instead of .html/.htm.

Yeah, that would be a hassle, but if I can't get the php scripts to
run in html files that may be what I'll have to do. I'd need to see
how those php files would interact with the many html files they link
to.

>If you don't want to rename files, then you need to look at javascript
>solution for displaying last modified document time.

I whipped up a javascript to do what I want days ago, but a lot of
people keep javascript turned off, so it wouldn't work for them. I
supposed I could figure out how to get some message put in place of
the file modification date if javascript is turned off.

Thanks for your help.

Re: Newbie needs recommendation for fast learning a little php.

<ik545bF93qmU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=270&group=comp.lang.php#270

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: user@example.net (J.O. Aho)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Thu, 1 Jul 2021 08:03:23 +0200
Lines: 126
Message-ID: <ik545bF93qmU1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
<ik3d56Fti4nU1@mid.individual.net>
<ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>
<ik4264F3479U1@mid.individual.net>
<4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net QXpUCkFXG0qmUH82kr4u+wgjNGxZTYOX/PTUeOfcrhAp7m1DUf
Cancel-Lock: sha1:9Q1pssNthOwkfj/T6nY2mKUc0uE=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
In-Reply-To: <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>
Content-Language: en-US-large
 by: J.O. Aho - Thu, 1 Jul 2021 06:03 UTC

On 01/07/2021 06.49, Not_even_a_newbie@example.net wrote:
> On Wed, 30 Jun 2021 22:23:32 +0200, "J.O. Aho" <user@example.net>
> wrote:
>
>>
>> On 30/06/2021 19.49, Not_even_a_newbie@example.net wrote:
>>> On Wed, 30 Jun 2021 16:24:38 +0200, "J.O. Aho" <user@example.net>
>>> wrote:
>>>
>>>> On 30/06/2021 14.08, Not_even_a_newbie@example.net wrote:
>>>>> This does what I want, but only as a .PHP file. How do I get it into a
>>>>> file named foo.html so I can have foo.html declare when it was last
>>>>> modified?
>>>>>
>>>>> <?php
>>>>> $file = $_SERVER["SCRIPT_NAME"];
>>>>> $break = Explode('/', $file);
>>>>> $pfile = $break[count($break) - 1];
>>>>> //echo $pfile;
>>>>> echo "This file was last modified on: " .date("Y-m-d
>>>>> H:m",filemtime($pfile));
>>>>> ?>
>>>>>
>>>>> I feel as if I'm almost there.
>>>>
>>>> I won't comment on the code as Arno already done that, there is two
>>>> options, I would say one option is not up to you, so in reality you have
>>>> only one option (the last one)
>>>>
>>>> 1. Make the webserver to send .html files to tne php engine as it does
>>>> with the .php files.
>>>>
>>>> 2. Rename the .html file to .php
>>>
>>> Uh oh. But I'm reading that I can embed php into a html file. Isn't
>>> that possible?
>>
>> The issue is that the web server will not treat each file it handles as
>> a php code, it will only look for files that ends with php, send those
>> to a PHP-engine which parses the file and executes the php code and then
>> hands back the output to the web server which then sends the output to
>> the end user (the visitor to your web page).
>>
>> It's possible to allow .html/.htm files the same way, but then you need
>> the administration rights of the server, as you are using a shared
>> service, it means you don't have administrator privileges and those you
>> can't do the change.
>
> Thanks for clarifying that. I don't control the server, but I've read
> that those who do can allow html files to be scanned for php code.
> Maybe my Web host has in fact done that. Would I be able to find some
> notation about that in the Web host's phpinfo.php file?
>
> Also, some scripts seem to work in html files and some don't.
>
> The following is the entire code for a file I named hello_1.html
>
> <html>
> <head>
> <title>PHP Test</title>
> </head>
> <body>
> <?php echo '<p>Hello World</p>'; ?>
> </body>
> </html>
>
> It produced the result:
>
> "Hello World
>
> '; ?> "
>
> in the browser. It's obviously got a little problem in the output, but
> it did produce a mostly useful output.

No, it's your web browsers html engine that detects a faulty html tag
with another html tag and tries it best to correct the html and shows
you what it thinks should be shown.

Had you written:

<?php echo 1+1; ?>

your output had been:

yes, nothing at all, and that is the proof of that the php code do not
be executed, had the php engine processed the page before sent to you,
you would have had a 2.

> Attempts to get the php script I actually want to use to run in an
> html file have not, so far, produced the thing the php script tries to
> do or else the file doesn't produce any result at all.

As long it's in a file ending with html/htm it will not be executed, so
matter what you write, nothing will happen, you need to change the
ending to php.

>> So this leads to the only thing you can do, rename your files so that
>> they are called .php instead of .html/.htm.
>
> Yeah, that would be a hassle, but if I can't get the php scripts to
> run in html files that may be what I'll have to do. I'd need to see
> how those php files would interact with the many html files they link
> to.

You just need to change the links to the new page name that ends with
..php and that's it.

>> If you don't want to rename files, then you need to look at javascript
>> solution for displaying last modified document time.
>
> I whipped up a javascript to do what I want days ago, but a lot of
> people keep javascript turned off, so it wouldn't work for them. I
> supposed I could figure out how to get some message put in place of
> the file modification date if javascript is turned off.

Itnernet is nowadays quite useless without javascript, so people tend to
not disable it anymore. The benefit with the javascript is that you can
display time the file was modified based on the users timezone.

--

//Aho

Re: Newbie needs recommendation for fast learning a little php.

<ik5dseFatucU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=271&group=comp.lang.php#271

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@arnowelzel.de (Arno Welzel)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Thu, 1 Jul 2021 10:49:18 +0200
Lines: 57
Message-ID: <ik5dseFatucU1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
<ik38p4Fsqc5U1@mid.individual.net>
<ut9pdg5ou2tg89810v9eshhv1p26c1snl2@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net bbW7p8ZnuSrC0AixJDHzDAEVg/2giAR423A4kcA4K4zHwo28Mg
Cancel-Lock: sha1:z3PyxQSmDUFtwMePeQgmX7pd4x0=
In-Reply-To: <ut9pdg5ou2tg89810v9eshhv1p26c1snl2@4ax.com>
 by: Arno Welzel - Thu, 1 Jul 2021 08:49 UTC

Not_even_a_newbie@example.net:

> On Wed, 30 Jun 2021 15:09:57 +0200, Arno Welzel <usenet@arnowelzel.de>
> wrote:
[...]
>> Much simpler:
>>
>> <?php
>> echo "This file was last modified on: ";
>> echo date("Y-m-d H:m",filemtime($_SERVER["SCRIPT_FILENAME"]));
>> ?>
>
> Thanks for that. I've plugged this in and saved it as foo.php and I
> get an odd reaction. The actual time stamp on the file is 13:22, but
> the above script is telling me that the file was last modified at
> 13:06. I suppose that the idiots at my Web host may have screwed up
> something on the server. The 13:22 time is when I created the file, so
> it can't be that it's showing when it was created and not when it was
> modified. I'm scratching my head here.

You can also try this to make sure the file system cache is emptied:

<?php
clearstatcache($_SERVER["SCRIPT_FILENAME"]);
echo "This file was last modified on: ";
echo date("Y-m-d H:m",filemtime($_SERVER["SCRIPT_FILENAME"]));
?>

And if this doesn't work, use a global cache clear:

<?php
clearstatcache();
echo "This file was last modified on: ";
echo date("Y-m-d H:m",filemtime($_SERVER["SCRIPT_FILENAME"]));
?>

Also see: <https://www.php.net/manual/en/function.clearstatcache.php>

>> Also see:
>>
>> <https://www.php.net/manual/en/reserved.variables.server.php>
>>
>> "'SCRIPT_FILENAME'
>>
>> The absolute pathname of the currently executing script."
>
> Okay, I don't understand what you mean in the piece immediately above
> this. The above url seems to say that the script will just run.

$_SERVER is a super global array which provides a number of runtime
parameters of the current script. $_SERVER["SCRIPT_FILENAME"] contains
the complete name of the current script including the path or the name
which was passed at command line when using PHP as CLI.

--
Arno Welzel
https://arnowelzel.de

Re: Newbie needs recommendation for fast learning a little php.

<ik5jntFc11hU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=272&group=comp.lang.php#272

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@arnowelzel.de (Arno Welzel)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Thu, 1 Jul 2021 12:29:17 +0200
Lines: 17
Message-ID: <ik5jntFc11hU1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
<ik3d56Fti4nU1@mid.individual.net>
<ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net YJ4fuJMHiEF9PWswyEkUbAKypt1yoYqB+RYWWbqwQdt9XvcQWg
Cancel-Lock: sha1:0FPpYZVJtD+67JJtOjNnarutATs=
In-Reply-To: <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>
 by: Arno Welzel - Thu, 1 Jul 2021 10:29 UTC

Not_even_a_newbie@example.net:

> On Wed, 30 Jun 2021 16:24:38 +0200, "J.O. Aho" <user@example.net>
> wrote:
[...]
>> 2. Rename the .html file to .php
>
> Uh oh. But I'm reading that I can embed php into a html file. Isn't
> that possible?

It is - but the file must be processed by PHP. This usually does not
happen, when the file exension is ".html".

--
Arno Welzel
https://arnowelzel.de

Re: Newbie needs recommendation for fast learning a little php.

<ik5k3hFc3olU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=273&group=comp.lang.php#273

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@arnowelzel.de (Arno Welzel)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Thu, 1 Jul 2021 12:35:29 +0200
Lines: 98
Message-ID: <ik5k3hFc3olU1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
<ik3d56Fti4nU1@mid.individual.net>
<ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>
<ik4264F3479U1@mid.individual.net>
<4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 7BWVkV9M8mcffoY0UTrzMQE0E8wcjqojsJi6nJixVwVlcx7u56
Cancel-Lock: sha1:VjSAibaltTBgeahk8uGu5teSUh0=
In-Reply-To: <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>
 by: Arno Welzel - Thu, 1 Jul 2021 10:35 UTC

Not_even_a_newbie@example.net:

> On Wed, 30 Jun 2021 22:23:32 +0200, "J.O. Aho" <user@example.net>
> wrote:
>
>>
>> On 30/06/2021 19.49, Not_even_a_newbie@example.net wrote:
>>> On Wed, 30 Jun 2021 16:24:38 +0200, "J.O. Aho" <user@example.net>
>>> wrote:
>>>
>>>> On 30/06/2021 14.08, Not_even_a_newbie@example.net wrote:
>>>>> This does what I want, but only as a .PHP file. How do I get it into a
>>>>> file named foo.html so I can have foo.html declare when it was last
>>>>> modified?
>>>>>
>>>>> <?php
>>>>> $file = $_SERVER["SCRIPT_NAME"];
>>>>> $break = Explode('/', $file);
>>>>> $pfile = $break[count($break) - 1];
>>>>> //echo $pfile;
>>>>> echo "This file was last modified on: " .date("Y-m-d
>>>>> H:m",filemtime($pfile));
>>>>> ?>
>>>>>
>>>>> I feel as if I'm almost there.
>>>>
>>>> I won't comment on the code as Arno already done that, there is two
>>>> options, I would say one option is not up to you, so in reality you have
>>>> only one option (the last one)
>>>>
>>>> 1. Make the webserver to send .html files to tne php engine as it does
>>>> with the .php files.
>>>>
>>>> 2. Rename the .html file to .php
>>>
>>> Uh oh. But I'm reading that I can embed php into a html file. Isn't
>>> that possible?
>>
>> The issue is that the web server will not treat each file it handles as
>> a php code, it will only look for files that ends with php, send those
>> to a PHP-engine which parses the file and executes the php code and then
>> hands back the output to the web server which then sends the output to
>> the end user (the visitor to your web page).
>>
>> It's possible to allow .html/.htm files the same way, but then you need
>> the administration rights of the server, as you are using a shared
>> service, it means you don't have administrator privileges and those you
>> can't do the change.
>
> Thanks for clarifying that. I don't control the server, but I've read
> that those who do can allow html files to be scanned for php code.
> Maybe my Web host has in fact done that. Would I be able to find some
> notation about that in the Web host's phpinfo.php file?
>
> Also, some scripts seem to work in html files and some don't.
>
> The following is the entire code for a file I named hello_1.html
>
> <html>
> <head>
> <title>PHP Test</title>
> </head>
> <body>
> <?php echo '<p>Hello World</p>'; ?>
> </body>
> </html>
>
> It produced the result:
>
> "Hello World
>
> '; ?> "
>
> in the browser. It's obviously got a little problem in the output, but
> it did produce a mostly useful output.

No. The output comes from the fact, that PHP was *not* interpreted.

The browser displays *exactly* this:

<?php echo '<p>Hello World</p>'; ?>

Just have a look at the source of the page which is displayed by the
browser.

Since <?php will treated by the browser as the beginning of a tag, it
will be omitted in the visible output. But "; ?>" is clearly left over
as the PHP code was *not* interpreted but just sent to the browser. The
result is then what you see.

If renaming everything from .html to .php you should look for a hosting
service which allows using .html with PHP as well. Technically this is
just a configuration in the webserver - however that is usually not
possible in shared hosting environments.

--
Arno Welzel
https://arnowelzel.de

Re: Newbie needs recommendation for fast learning a little php.

<sblcg5$igi$1@reader1.panix.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=274&group=comp.lang.php#274

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix2.panix.com!not-for-mail
From: rcpj@panix.com (Pierre Jelenc)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Thu, 1 Jul 2021 21:36:05 -0000 (UTC)
Organization: Public Access Networks Corp.
Message-ID: <sblcg5$igi$1@reader1.panix.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com> <ik4264F3479U1@mid.individual.net> <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>
Injection-Date: Thu, 1 Jul 2021 21:36:05 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="panix2.panix.com:166.84.1.2";
logging-data="18962"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
 by: Pierre Jelenc - Thu, 1 Jul 2021 21:36 UTC

In article <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>,
<Not_even_a_newbie@example.net> wrote:
>
>Thanks for clarifying that. I don't control the server, but I've read
>that those who do can allow html files to be scanned for php code.
>Maybe my Web host has in fact done that. Would I be able to find some
>notation about that in the Web host's phpinfo.php file?

You don't need to control the server itself; many hosts --indeed all the
good ones, I say-- allow you to redirect .html to the PHP engine one way
or another, typically from .htaccess with AddType and AddHandler
directives. Check your host's help system or file a support ticket, they
probably have a FAQ answer ready.

Pierre

--
Pierre Jelenc
The Gigometer www.gigometer.com
The NYC Beer Guide www.nycbeer.org

Re: Newbie needs recommendation for fast learning a little php.

<hd3vdghs6pi30ft7b453kroq2tes78rk1q@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=275&group=comp.lang.php#275

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder5.feed.usenet.farm!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <hd3vdghs6pi30ft7b453kroq2tes78rk1q@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <MPG.3b46fa846ceca8c8989885@news.individual.net>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 27
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Fri, 02 Jul 2021 22:07:51 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Fri, 02 Jul 2021 18:07:50 -0400
X-Received-Bytes: 2130
 by: Not_even_a_newbie@example.net - Fri, 2 Jul 2021 22:07 UTC

On Wed, 30 Jun 2021 23:03:22 +0200, Ray_Net
<Ray_Net@picarre.be.invalid> wrote:

>In article <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>, Not_even_a_newbie@example.net says...
>>
>> I don't even know if I'm up to the level of being a newbie at this
>> point. I mostly need to do a specific thing, get a html file to
>> display its last modified date and time inside itself.
>>
>> I'm not sure a book is going to be that useful, but maybe a Web site
>> could be. I'd need one that really is basic.
>>
>> I've found a Web page or two, but they seem to assume that I know more
>> than I do because I can't get the code snippets I've found on those
>> Web pages to work.
>>
>> I used to use ssi for this, but I moved to a new Web host and they
>> seem to have their server time zone set as the only time zone I can
>> display, and they are far away from me, so in ssi I get a date and
>> time for a file modification time that's many hours off. I'm hoping
>> that php will solve my problem. Thanks in advance.
>
>https://code.adonline.id.au/last-modified-date-php/

I had been looking around for days and I didn't run across that Web
page. Wish I'd seen it sooner, although I don't know yet if it's going
to solve my problems. Thanks for that link.

Re: Newbie needs recommendation for fast learning a little php.

<sj3vdgluqmvdlk7enk24an6djud9o7eenb@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=276&group=comp.lang.php#276

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!ecngs!feeder2.ecngs.de!178.20.174.213.MISMATCH!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <sj3vdgluqmvdlk7enk24an6djud9o7eenb@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com> <ik3d56Fti4nU1@mid.individual.net> <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com> <ik4264F3479U1@mid.individual.net> <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com> <ik5k3hFc3olU1@mid.individual.net>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 145
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Fri, 02 Jul 2021 22:21:10 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Fri, 02 Jul 2021 18:21:10 -0400
X-Received-Bytes: 6030
 by: Not_even_a_newbie@example.net - Fri, 2 Jul 2021 22:21 UTC

On Thu, 1 Jul 2021 12:35:29 +0200, Arno Welzel <usenet@arnowelzel.de>
wrote:

>Not_even_a_newbie@example.net:
>
>> On Wed, 30 Jun 2021 22:23:32 +0200, "J.O. Aho" <user@example.net>
>> wrote:
>>
>>>
>>> On 30/06/2021 19.49, Not_even_a_newbie@example.net wrote:
>>>> On Wed, 30 Jun 2021 16:24:38 +0200, "J.O. Aho" <user@example.net>
>>>> wrote:
>>>>
>>>>> On 30/06/2021 14.08, Not_even_a_newbie@example.net wrote:
>>>>>> This does what I want, but only as a .PHP file. How do I get it into a
>>>>>> file named foo.html so I can have foo.html declare when it was last
>>>>>> modified?
>>>>>>
>>>>>> <?php
>>>>>> $file = $_SERVER["SCRIPT_NAME"];
>>>>>> $break = Explode('/', $file);
>>>>>> $pfile = $break[count($break) - 1];
>>>>>> //echo $pfile;
>>>>>> echo "This file was last modified on: " .date("Y-m-d
>>>>>> H:m",filemtime($pfile));
>>>>>> ?>
>>>>>>
>>>>>> I feel as if I'm almost there.
>>>>>
>>>>> I won't comment on the code as Arno already done that, there is two
>>>>> options, I would say one option is not up to you, so in reality you have
>>>>> only one option (the last one)
>>>>>
>>>>> 1. Make the webserver to send .html files to tne php engine as it does
>>>>> with the .php files.
>>>>>
>>>>> 2. Rename the .html file to .php
>>>>
>>>> Uh oh. But I'm reading that I can embed php into a html file. Isn't
>>>> that possible?
>>>
>>> The issue is that the web server will not treat each file it handles as
>>> a php code, it will only look for files that ends with php, send those
>>> to a PHP-engine which parses the file and executes the php code and then
>>> hands back the output to the web server which then sends the output to
>>> the end user (the visitor to your web page).
>>>
>>> It's possible to allow .html/.htm files the same way, but then you need
>>> the administration rights of the server, as you are using a shared
>>> service, it means you don't have administrator privileges and those you
>>> can't do the change.
>>
>> Thanks for clarifying that. I don't control the server, but I've read
>> that those who do can allow html files to be scanned for php code.
>> Maybe my Web host has in fact done that. Would I be able to find some
>> notation about that in the Web host's phpinfo.php file?
>>
>> Also, some scripts seem to work in html files and some don't.
>>
>> The following is the entire code for a file I named hello_1.html
>>
>> <html>
>> <head>
>> <title>PHP Test</title>
>> </head>
>> <body>
>> <?php echo '<p>Hello World</p>'; ?>
>> </body>
>> </html>
>>
>> It produced the result:
>>
>> "Hello World
>>
>> '; ?> "
>>
>> in the browser. It's obviously got a little problem in the output, but
>> it did produce a mostly useful output.
>
>No. The output comes from the fact, that PHP was *not* interpreted.
>
>The browser displays *exactly* this:
>
><?php echo '<p>Hello World</p>'; ?>
>
>Just have a look at the source of the page which is displayed by the
>browser.
>
>Since <?php will treated by the browser as the beginning of a tag, it
>will be omitted in the visible output. But "; ?>" is clearly left over
>as the PHP code was *not* interpreted but just sent to the browser. The
>result is then what you see.
>
>If renaming everything from .html to .php you should look for a hosting
>service which allows using .html with PHP as well. Technically this is
>just a configuration in the webserver - however that is usually not
>possible in shared hosting environments.

It is possible that I have gotten the magic words into the .htaccess
file and I think that I'm able to run PHP scripts from within HTML
files. Even so, I am thinking that I've really been going about this
the wrong way. I may need to learn how to inject HTML into PHP rather
than the other way around, which I've been trying to do.

Anyway, I cobbled together the following code after I seem to have
gotten the server to execute PHP inside every HTML file.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>will php run in html now?</title>
<meta http-equiv="description" content="">
<meta http-equiv="keywords" content=",">
<meta http-equiv="distribution" content="global">
<meta http-equiv="resource-type" content="document">

</head>
<body>

<h1>Am I Going To Get it Now?</h1>

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>

<br>
<br>
Updated:
<?php
date_default_timezone_set('America/New_York');
$file = $_SERVER["SCRIPT_NAME"];
$break = Explode('/', $file);
$pfile = $break[count($break) - 1];
echo "" .date("Y-m-d H:m",filemtime($pfile));
?>

The output of that code was:

Am I Going To Get it Now?

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Updated: 2021-07-02 18:07

That mostly looks okay. I have more to say on it, but I think I'll do
that in a separate post for reasons which I think will become obvious.

Re: Newbie needs recommendation for fast learning a little php.

<lb4vdg1uqp8p7hhirnni6uqk2h147m0eq3@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=277&group=comp.lang.php#277

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!aioe.org!feeder5.feed.usenet.farm!feeder1.feed.usenet.farm!feed.usenet.farm!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <lb4vdg1uqp8p7hhirnni6uqk2h147m0eq3@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com> <ik4264F3479U1@mid.individual.net> <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com> <sblcg5$igi$1@reader1.panix.com>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 34
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Fri, 02 Jul 2021 22:49:50 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Fri, 02 Jul 2021 18:49:49 -0400
X-Received-Bytes: 2605
 by: Not_even_a_newbie@example.net - Fri, 2 Jul 2021 22:49 UTC

On Thu, 1 Jul 2021 21:36:05 -0000 (UTC), rcpj@panix.com (Pierre
Jelenc) wrote:

>In article <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>,
> <Not_even_a_newbie@example.net> wrote:
>>
>>Thanks for clarifying that. I don't control the server, but I've read
>>that those who do can allow html files to be scanned for php code.
>>Maybe my Web host has in fact done that. Would I be able to find some
>>notation about that in the Web host's phpinfo.php file?
>
>You don't need to control the server itself; many hosts --indeed all the
>good ones, I say-- allow you to redirect .html to the PHP engine one way
>or another, typically from .htaccess with AddType and AddHandler
>directives. Check your host's help system or file a support ticket, they
>probably have a FAQ answer ready.

I have apparently gotten the server to process PHP scripts inside the
HTML file. Things is, that's kind of wasteful and may slow things
down, for me and for others. I did read on one of the many Web pages
I've been looking at over this topic that besides putting "AddType
application/x-httpd-php .html" into my .htaccess file, and making ALL
HTML files get processed for any PHP scripts, that there was also a
way to do it for a single file. I have about five files I need to do
this modification notice for.

The code for a single file that I saw was "<Files yourpage.html>
AddType application/x-httpd-php .html </Files>" where yourpage.html
was whatever that one file was named.

Does anyone know if it's possible to use that declaration, or
something like it, in the .htaccess file so that only the five HTML
files that really need to have PHP processed will get processed and
all other HTML files will not be?

Re: Newbie needs recommendation for fast learning a little php.

<sbo5ut$n7p$1@reader1.panix.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=278&group=comp.lang.php#278

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix2.panix.com!not-for-mail
From: rcpj@panix.com (Pierre Jelenc)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Fri, 2 Jul 2021 23:02:53 -0000 (UTC)
Organization: Public Access Networks Corp.
Message-ID: <sbo5ut$n7p$1@reader1.panix.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com> <sblcg5$igi$1@reader1.panix.com> <lb4vdg1uqp8p7hhirnni6uqk2h147m0eq3@4ax.com>
Injection-Date: Fri, 2 Jul 2021 23:02:53 -0000 (UTC)
Injection-Info: reader1.panix.com; posting-host="panix2.panix.com:166.84.1.2";
logging-data="23801"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
 by: Pierre Jelenc - Fri, 2 Jul 2021 23:02 UTC

In article <lb4vdg1uqp8p7hhirnni6uqk2h147m0eq3@4ax.com>,
<Not_even_a_newbie@example.net> wrote:
>On Thu, 1 Jul 2021 21:36:05 -0000 (UTC), rcpj@panix.com (Pierre
>Jelenc) wrote:
>
>>In article <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>,
>> <Not_even_a_newbie@example.net> wrote:
>>>
>>>Thanks for clarifying that. I don't control the server, but I've read
>>>that those who do can allow html files to be scanned for php code.
>>>Maybe my Web host has in fact done that. Would I be able to find some
>>>notation about that in the Web host's phpinfo.php file?
>>
>>You don't need to control the server itself; many hosts --indeed all the
>>good ones, I say-- allow you to redirect .html to the PHP engine one way
>>or another, typically from .htaccess with AddType and AddHandler
>>directives. Check your host's help system or file a support ticket, they
>>probably have a FAQ answer ready.
>
>I have apparently gotten the server to process PHP scripts inside the
>HTML file. Things is, that's kind of wasteful and may slow things
>down, for me and for others. I did read on one of the many Web pages
>I've been looking at over this topic that besides putting "AddType
>application/x-httpd-php .html" into my .htaccess file, and making ALL
>HTML files get processed for any PHP scripts, that there was also a
>way to do it for a single file. I have about five files I need to do
>this modification notice for.
>
>The code for a single file that I saw was "<Files yourpage.html>
>AddType application/x-httpd-php .html </Files>" where yourpage.html
>was whatever that one file was named.
>
>Does anyone know if it's possible to use that declaration, or
>something like it, in the .htaccess file so that only the five HTML
>files that really need to have PHP processed will get processed and
>all other HTML files will not be?

It should work (but again, it depends on the way the server is set up).
Alternatively, rename the relevant files to .htm and redirect .htm to PHP
but leave .html alone.

Pierre
--
Pierre Jelenc
The Gigometer www.gigometer.com
The NYC Beer Guide www.nycbeer.org

Re: Newbie needs recommendation for fast learning a little php.

<jg7vdg9kts2sb2kb0putsfpf7skp1j14rk@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=279&group=comp.lang.php#279

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <jg7vdg9kts2sb2kb0putsfpf7skp1j14rk@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com> <ik3d56Fti4nU1@mid.individual.net> <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com> <ik4264F3479U1@mid.individual.net> <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com> <ik5k3hFc3olU1@mid.individual.net> <sj3vdgluqmvdlk7enk24an6djud9o7eenb@4ax.com>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 53
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Fri, 02 Jul 2021 23:36:10 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Fri, 02 Jul 2021 19:36:09 -0400
X-Received-Bytes: 2642
 by: Not_even_a_newbie@example.net - Fri, 2 Jul 2021 23:36 UTC

All right, here's a weird part.

After this code and output
>....
><!DOCTYPE html>
><html lang="en">
><head>
><meta charset="utf-8">
><title>will php run in html now?</title>
><meta http-equiv="description" content="">
><meta http-equiv="keywords" content=",">
><meta http-equiv="distribution" content="global">
><meta http-equiv="resource-type" content="document">
>
></head>
><body>
>
><h1>Am I Going To Get it Now?</h1>
>
><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
>
><br>
><br>
>Updated:
><?php
>date_default_timezone_set('America/New_York');
>$file = $_SERVER["SCRIPT_NAME"];
>$break = Explode('/', $file);
>$pfile = $break[count($break) - 1];
>echo "" .date("Y-m-d H:m",filemtime($pfile));
>?>
>
>The output of that code was:
>
>Am I Going To Get it Now?
>
>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
>
>Updated: 2021-07-02 18:07
>....

No matter what I do I always get the same minutes. The hour changes,
but the minutes are staying the same. I changed the file a bit, and
saved it again and again but the "07" stayed. So right now the string
says the file was modified at 2021-07-02 19:07 even though it's later
than that by a lot and this happened in the previous hour as well.

This can't be something wrong with the code, can it? I think it must
be something wrong with the server. I just know that when I bring this
up to my Web host they're going to say it's the code that's at fault.
Is that possible?

Anyone have an opinion on this?

Re: Newbie needs recommendation for fast learning a little php.

<ik9nmbF5uhnU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=280&group=comp.lang.php#280

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: jpstewart@personalprojects.net (John-Paul Stewart)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Fri, 2 Jul 2021 20:01:13 -0400
Lines: 10
Message-ID: <ik9nmbF5uhnU1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
<ik3d56Fti4nU1@mid.individual.net>
<ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>
<ik4264F3479U1@mid.individual.net>
<4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>
<ik5k3hFc3olU1@mid.individual.net>
<sj3vdgluqmvdlk7enk24an6djud9o7eenb@4ax.com>
<jg7vdg9kts2sb2kb0putsfpf7skp1j14rk@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net EJgjuHqmtU9vsvkr5WZ8ngyu4emwSKuNmt01dOFlwn52x8x86i
Cancel-Lock: sha1:GjLdk1xpdFMFxvzG5ds8nrSaSqw=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
In-Reply-To: <jg7vdg9kts2sb2kb0putsfpf7skp1j14rk@4ax.com>
Content-Language: en-CA
 by: John-Paul Stewart - Sat, 3 Jul 2021 00:01 UTC

On 2021-07-02 7:36 p.m., Not_even_a_newbie@example.net wrote:
>> echo "" .date("Y-m-d H:m",filemtime($pfile));
>
> No matter what I do I always get the same minutes.

You're not showing minutes at all. Lower case m is month number (as you
used in the date). You probably want H:i for hour and minutes; hour
and month is an odd pairing!

https://www.php.net/manual/en/datetime.format.php

Re: Newbie needs recommendation for fast learning a little php.

<lqnvdglp97sqom6q4qupd1cde9t8num9b8@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=281&group=comp.lang.php#281

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fdc2.netnews.com!news-out.netnews.com!news.alt.net!fdc3.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <lqnvdglp97sqom6q4qupd1cde9t8num9b8@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com> <ik3d56Fti4nU1@mid.individual.net> <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com> <ik4264F3479U1@mid.individual.net> <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com> <ik5k3hFc3olU1@mid.individual.net> <sj3vdgluqmvdlk7enk24an6djud9o7eenb@4ax.com> <jg7vdg9kts2sb2kb0putsfpf7skp1j14rk@4ax.com> <ik9nmbF5uhnU1@mid.individual.net>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 20
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Sat, 03 Jul 2021 04:08:20 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Sat, 03 Jul 2021 00:08:18 -0400
X-Received-Bytes: 1867
 by: Not_even_a_newbie@example.net - Sat, 3 Jul 2021 04:08 UTC

On Fri, 2 Jul 2021 20:01:13 -0400, John-Paul Stewart
<jpstewart@personalprojects.net> wrote:

>On 2021-07-02 7:36 p.m., Not_even_a_newbie@example.net wrote:
>>> echo "" .date("Y-m-d H:m",filemtime($pfile));
>>
>> No matter what I do I always get the same minutes.
>
>You're not showing minutes at all. Lower case m is month number (as you
>used in the date).

D'oh! I'm going back and forth so much here that I missed that
entirely. Thanks a lot for pointing out my error.

>You probably want H:i for hour and minutes; hour
>and month is an odd pairing!

Yes, the page gives the right modification time now. Thanks a lot.

>https://www.php.net/manual/en/datetime.format.php

Re: Newbie needs recommendation for fast learning a little php.

<ikb7mhFeiu9U1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=282&group=comp.lang.php#282

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: usenet@arnowelzel.de (Arno Welzel)
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Date: Sat, 3 Jul 2021 15:40:33 +0200
Lines: 18
Message-ID: <ikb7mhFeiu9U1@mid.individual.net>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com>
<35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com>
<ik3d56Fti4nU1@mid.individual.net>
<ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com>
<ik4264F3479U1@mid.individual.net>
<4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com>
<ik5k3hFc3olU1@mid.individual.net>
<sj3vdgluqmvdlk7enk24an6djud9o7eenb@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net vbEJn9z9B123PkNSS8htRgNbYtlB85VJ7NkuIbRR/OgF5NP9Fn
Cancel-Lock: sha1:XZ/5FynmQmTaIczZfY8YedbSCaQ=
In-Reply-To: <sj3vdgluqmvdlk7enk24an6djud9o7eenb@4ax.com>
 by: Arno Welzel - Sat, 3 Jul 2021 13:40 UTC

Not_even_a_newbie@example.net:

[...]
> <?php
> date_default_timezone_set('America/New_York');
> $file = $_SERVER["SCRIPT_NAME"];
> $break = Explode('/', $file);

The function name is "explode()" in lower case and not "Explode()". Even
if PHP accepts the upper case version as well you should use the correct
case to avoid problems with future updates.

Also see: <https://www.php.net/manual/en/function.explode.php>

--
Arno Welzel
https://arnowelzel.de

Re: Newbie needs recommendation for fast learning a little php.

<jab1egtohva3pt7p75u25lcqpkm4h60qaq@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=283&group=comp.lang.php#283

  copy link   Newsgroups: comp.lang.php alt.comp.lang.php alt.php
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx39.iad.POSTED!not-for-mail
From: Not_even_a_newbie@example.net
Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php
Subject: Re: Newbie needs recommendation for fast learning a little php.
Message-ID: <jab1egtohva3pt7p75u25lcqpkm4h60qaq@4ax.com>
References: <rdbmdghp8532b2sgknb9iqv6a0i6vlom8p@4ax.com> <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com> <ik3d56Fti4nU1@mid.individual.net> <ogbpdgl0n036k6ughn109an0kms17jl59s@4ax.com> <ik4264F3479U1@mid.individual.net> <4mcqdgtiqjshpeg88h50b5l97fp3qmflfu@4ax.com> <ik5k3hFc3olU1@mid.individual.net> <sj3vdgluqmvdlk7enk24an6djud9o7eenb@4ax.com> <ikb7mhFeiu9U1@mid.individual.net>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 18
X-Complaints-To: abuse(at)newshosting.com
NNTP-Posting-Date: Sat, 03 Jul 2021 18:36:13 UTC
Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com
Date: Sat, 03 Jul 2021 14:36:11 -0400
X-Received-Bytes: 1689
 by: Not_even_a_newbie@example.net - Sat, 3 Jul 2021 18:36 UTC

On Sat, 3 Jul 2021 15:40:33 +0200, Arno Welzel <usenet@arnowelzel.de>
wrote:

>Not_even_a_newbie@example.net:
>
>[...]
>> <?php
>> date_default_timezone_set('America/New_York');
>> $file = $_SERVER["SCRIPT_NAME"];
>> $break = Explode('/', $file);
>
>The function name is "explode()" in lower case and not "Explode()". Even
>if PHP accepts the upper case version as well you should use the correct
>case to avoid problems with future updates.

Okay, thanks. I've corrected that now.

>Also see: <https://www.php.net/manual/en/function.explode.php>

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor