On 01/07/2021 06.49,
Not_even...@example.net wrote:
> On Wed, 30 Jun 2021 22:23:32 +0200, "J.O. Aho" <
us...@example.net>
> 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