Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

have index.php load another file?

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

Moderator: daj

Post Reply
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

have index.php load another file?

Post by n9mfk »

Hi all,
im look for a easy to have index.php load another file
i have a file called test.php i know i could copy what in test.php into index.php i do not went to do that thanks for any idea
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: have index.php load another file?

Post by daj »

within index.php

Code: Select all

include('test.php');
You can also use 'require' which is the same as include, but stops executing if it can not load/find the extra file.

I usually always use

Code: Select all

require_once('test.php');
which is a little more advanced but does the same job -- it just does not re-include the file if it has been included elsewhere in the script.

your test.php file needs to include PHP tags too....

Code: Select all

<?php
..
..
?>
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: have index.php load another file?

Post by gemini06720 »

Beau, you might want to have a look at the W3Schools Online Web Tutorials, a great site with a lot of easy to understand information, tutorials, references, and examples... ;)
Last edited by gemini06720 on Sat 26 Feb 2011 10:16 pm, edited 1 time in total.
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: have index.php load another file?

Post by daj »

Indeed -- it's a brilliant site to learn from
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
Gina
Posts: 1885
Joined: Sat 21 Feb 2009 12:41 pm
Weather Station: Nothing working ATM - making one
Operating System: OS X, Linux Mint, Win7 & XP
Location: Devon UK

Re: have index.php load another file?

Post by Gina »

Yes, I've learnt a lot from that sight :)
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: have index.php load another file?

Post by n9mfk »

That for all te great tips
Beau
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: have index.php load another file?

Post by gemini06720 »

Gina wrote:Yes, I've learnt a lot from that sight :)
Gina, you really mean "that sight"... :D
Gina
Posts: 1885
Joined: Sat 21 Feb 2009 12:41 pm
Weather Station: Nothing working ATM - making one
Operating System: OS X, Linux Mint, Win7 & XP
Location: Devon UK

Re: have index.php load another file?

Post by Gina »

gemini06720 wrote:
Gina wrote:Yes, I've learnt a lot from that sight :)
Gina, you really mean "that sight"... :D
Ooops! "site" is what I meant :oops: A senior moment there :lol:
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: have index.php load another file?

Post by gemini06720 »

Gina wrote:Ooops! "site" is what I meant :oops: A senior moment there :lol:
Senior! :o But, but... Gina you do not look a day over [fill the blank]... :mrgreen:
Post Reply