/    Sign up×
Community /Pin to ProfileBookmark

add in "news flash" type add on to HTML page

I came into this forum when I asked google [add in “news flash” type add on to HTML page]

What I want to do is modify a two of more HTML web pages, then by just writing one extra page (whatever) the text from that page gets automatically displayed on to all the HTML pages that got modified.

I am not sure if my basic PHP knowledge will do the answer without some untidy looking window in the page. also should I learn XML (if that is the way to go)

By the way
The reply I got from google link did not work

[B][SIZE=5]if this a repeat just delete it, not sure if I finished posting question [/SIZE][/B]

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJan 05.2017 — Using PHP to do it (if I understand "it" correctly) is certainly a viable option -- if your pages are created as PHP pages. The simplest way is with the PHP [url=http://php.net/readfile]readfile() function[/url].

news.txt (or whatever you want to call it):
[code=html]
<div id="news">
<h2>News<h2>
<p>This file has your news in it, marked up as HTML
that you want to use in your web pages.</p>
</div>
[/code]

some_page.php:
[code=php]
<html>
<head><title>Example</title></head>
<body>
<!-- stuff you want in the page markup before the news section -->
<?php readfile('path/to/news.txt'); ?>
<!-- stuff you want in the page markup after the news section -->
</body>
</html>
[/code]
Copy linkTweet thisAlerts:
@eric_aucklandauthorJan 05.2017 — Unfortunately NogDog they are all already HTML pages. so this is the problem. otherwise I may of come up with a solution similar to your answer.
Copy linkTweet thisAlerts:
@eric_aucklandauthorJan 06.2017 — Um what is this Sempervivum? how strange.
Copy linkTweet thisAlerts:
@TrainJan 06.2017 — Um what is this Sempervivum? how strange.[/QUOTE]

Forum error caught him. And when they hit you, forget everything.
Copy linkTweet thisAlerts:
@NogDogJan 06.2017 — It is possible to process files with .html suffixes as PHP (or with any other suffixes for that matter), as long as you can modify the web server config -- which could be done with a local .htaccess file in your site's directory if running Apache, something like:
<i>
</i>AddType application/x-httpd-php .html .htm .php
Copy linkTweet thisAlerts:
@eric_aucklandauthorJan 12.2017 — It is possible to process files with .html suffixes as PHP (or with any other suffixes for that matter), as long as you can modify the web server config -- which could be done with a local .htaccess file in your site's directory if running Apache, something like:
<i>
</i>AddType application/x-httpd-php .html .htm .php
[/QUOTE]



OK I put a file called[B] .htaccess [/B] at my website but I had to change the contents of the file to

[B]AddType application/x-httpd-php html htm php[/B]

(remove the 3 dots)

Now that was the only way I could get a file.php to come up when I put http://www.website.com/file.html

But then my website visitor recorder stopped working, so I put everything back to normal,

(the website visitor recorder is written in PHP and records information the a text file (filename.txt))
×

Success!

Help @eric_auckland spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...