Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Embedding a PHP script?

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Embedding a PHP script?

Post by daj »

I think we could help you out with a better refresh for your page

Code: Select all

<meta http-equiv="refresh" content="300" >
cough! The work of the Devil. :evil: LOL
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Embedding a PHP script?

Post by rp4111 »

Thanks for the help betle.

What do you suggest for a better method of auto refreshing?
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Embedding a PHP script?

Post by rp4111 »

I was doing some research tonight on PHP and came across this http://www.visitor-stats.com/articles/c ... te-php.php

This is what I found interesting:
Adding PHP functionality to HTML files

Download this file and upload it to the root directory of your website, then rename it to '.htaccess'

This tells your website server to look for any .htm or .html pages and treat them as if they where a .php page... all without even renaming your pages!

You don't even have to update your links, all of your .html or .html pages should be able to run PHP now.
Could this method be used with Cumulus?
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Embedding a PHP script?

Post by beteljuice »

beteljuice wrote:It is possible to tell the server to check .htm(l) files for php content, but I won't go into that.
WARNING !
You may already have a .htaccess file ! - you may even have one per directory.

NOTE: the . in front makes it "invisible" ! - That means you can't 'click' on it with a GUI ftp client.

If you can't 'see' the file check what options you have on your ftp client, you may be able to make it visible, or there may be a <right-click> 'manual' commands where you can type in the name of the file to transfer BACK TO YOUR PC and / or COPY to a 'visible' name.

You can experiment by making a file .myfile and uploading that to your web space to see what commands you may have to do.

Here is part of my 'public' .htaccess
EDIT: If you DO have one it WON'T look like this - an example of possible content ONLY !

ErrorDocument 404 /~dickie/404.html
addtype text/vnd.wap.wml wml
addtype application/vnd.wap.wmlc wmlc
addtype text/vnd.wap.wmlscript wmls
addtype application/vnd.wap.wmlscriptc wmlsc
addtype image/vnd.wap.wbmp wbmp
addtype x-world/x-svr svr
addtype audio/x-mpegurl .m3u

If you DO have an EXISTING .htaccess file, you will need to ADD the line:

Code: Select all

AddType application/x-httpd-php .htm .html
Exactly as seen above.
Then copy it back to your 'public' web space.

Then yes, ALL .htm and .html files will be parsed by the php pre-processor.
Last edited by beteljuice on Wed 05 Nov 2014 1:25 pm, edited 2 times in total.
Image
......................Imagine, what you will KNOW tomorrow !
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Embedding a PHP script?

Post by rp4111 »

I use E-rice.net and it DOES NOT have a .htaccess file anywhere on the server. I checked the forums and you must create one. Should I download the one it tells me to off of that site that I linked above? Or would it be better to start it from scratch?

EDIT: I think I may have it working. I took your .htaccess code and added that other code to it and uploaded it to my server. Then I found code for a simple digital clock for testing purposes and it seems to work!
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Embedding a PHP script?

Post by beteljuice »

You shouldn't need the code I posted !

That's 'old' stuff from the early days of WAP and a specialist (redundant) 3D graphics utility.

BTW this has seriously gone 'off topic' and beyond the remit of this forum.

.. although perhaps useful to others ;)
Image
......................Imagine, what you will KNOW tomorrow !
rp4111
Posts: 62
Joined: Wed 30 Dec 2009 11:31 pm
Weather Station: Davis VP2
Operating System: Windows XP, Mac OSX
Location: Western Massachusetts, USA
Contact:

Re: Embedding a PHP script?

Post by rp4111 »

Indeed it has! Thanks for all the help though. Maybe somebody else that comes along with be able to sift through all that and find something useful!
TNETWeather

Re: Embedding a PHP script?

Post by TNETWeather »

It's a way to get .htm or .html files to be parsed for php code.. but...

If you end up really using PHP you most likely will move away from the uploaded whole file templates since you can do more with much less uploading with a php template that you don't upload and just read the data obtained from a tag file.

One of the major advantages of php is that you don't have to upload all the html file over and over... which saves a lot of bandwidth.
Post Reply