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
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
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?
Moderator: daj
- 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?
within index.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
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
include('test.php');I usually always use
Code: Select all
require_once('test.php');your test.php file needs to include PHP tags too....
Code: Select all
<?php
..
..
?>
-
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?
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.
- 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?
Indeed -- it's a brilliant site to learn from
-
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?
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.
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?
That for all te great tips
Beau
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?
Gina, you really mean "that sight"...Gina wrote:Yes, I've learnt a lot from that sight
-
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?
Ooops! "site" is what I meantgemini06720 wrote:Gina, you really mean "that sight"...Gina wrote: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.
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?
Senior!Gina wrote:Ooops! "site" is what I meantA senior moment there