Page 1 of 2
Include
Posted: Sat Feb 19, 2005 10:51 am
by phelpsa
In
my forum calendar, if you click on the link it breaks out of the 'include ()'. How can I stop this??
Adam
Posted: Sat Feb 19, 2005 10:55 am
by feyd
fix the code so it doesn't break.
Posted: Sat Feb 19, 2005 11:30 am
by phelpsa
feyd wrote:fix the code so it doesn't break.
How do I do that?
Posted: Sat Feb 19, 2005 11:33 am
by Chris Corbyn
How do we know if we can't see your code.
Not 100% what you mean in any case.
Post your code and explain what you're trying to achieve. Surely your link just points to another file or chnages the arguments of the current location right?
You're currently in calendar.php (which includes a certain file right? index.php at a guess), so you're then linking to index.php and not surprisingly we end up at index.php when clicked.
You need to link to the page with the include() and use the appropriate arguments on that page.
Posted: Sat Feb 19, 2005 11:40 am
by phelpsa
go to
http://www.hillclimbsprint.co.uk/forum/calendarpage.php and click on 'Next Year'.
If you see it leaves the main page. How can I stop this.
The code is just:
Code: Select all
include ('www.hillclimbsprint.co.uk/forum/calendar/index.php')
Please be patient with me
Adam
Posted: Sat Feb 19, 2005 11:56 am
by feyd
including an external url requires the server to make a request and download that page, then pass the information on to you. Unless index.php returns php code when requested, you will only get the normal output of the file. If you want the php code that created the file, then you need to use a local include i.e. include('./calender/index.php') or simialr.
Posted: Sat Feb 19, 2005 12:03 pm
by phelpsa
When I do that it comes up with:
Warning: main(./includes/calendar.php): failed to open stream: No such file or directory in /home/www/hillclim/forum/calendar/index.php on line 66
Fatal error: main(): Failed opening required './includes/calendar.php' (include_path='.:/usr/local/lib/php') in /home/www/hillclim/forum/calendar/index.php on line 66
And it does exist.
Adam
Posted: Sat Feb 19, 2005 12:13 pm
by Chris Corbyn
You probably mispelt it or need to go up a driectory or two ( .. ).
If it's in a subfolder of the root then take out the dot
/includes/calendar.php
Posted: Sat Feb 19, 2005 12:14 pm
by feyd
you're aware that paths and filenames are case sensitive correct? You may need to play with the path used, as it may be different than what you think..
for instance, does /home/www/hillclim/forum/calendar/includes/calendar.php exist?
/includes/calendar.php will not exist, as the root of the server is very likely to be inaccessible.
Posted: Sat Feb 19, 2005 12:29 pm
by phelpsa
It does exist, but it says it doesn't

Posted: Sat Feb 19, 2005 1:05 pm
by smpdawg
Why are you adding the word includes in your path? You should be able to insert the line shown below just as it was suggested earlier.
phelpsa wrote:When I do that it comes up with:
Warning: main(./includes/calendar.php): failed to open stream: No such file or directory in /home/www/hillclim/forum/calendar/index.php on line 66
Fatal error: main(): Failed opening required './includes/calendar.php' (include_path='.:/usr/local/lib/php') in /home/www/hillclim/forum/calendar/index.php on line 66
And it does exist.
Adam
Posted: Sat Feb 19, 2005 1:16 pm
by phelpsa
Posted: Sat Feb 19, 2005 1:41 pm
by smpdawg
If you are online, contact me via AIM or Yahoo Messenger.
Posted: Sat Feb 19, 2005 2:38 pm
by phelpsa
Thanks!!
Posted: Sat Feb 19, 2005 2:43 pm
by phelpsa
Ok, basically what we did was change the root path of the index to root from the directory which calendarpage.php
So originally it said
and we changed it to
Big thanks to john.
Adam