Include
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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.
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.
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:
Please be patient with me
Adam
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')Adam
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
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.
When I do that it comes up with:
Adam
And it does exist.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
Adam
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
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.
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.
- smpdawg
- Forum Contributor
- Posts: 292
- Joined: Thu Jan 27, 2005 3:10 pm
- Location: Houston, TX
- Contact:
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.
Code: Select all
include('./calendar/index.php');phelpsa wrote:When I do that it comes up with:
And it does exist.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
Adam
Code: Select all
Because the page I want one page (http://www.hillclimbsprint.co.uk/forum/ ... /index.php) in another page (http://www.hillclimbsprint.co.uk/forum/calendarpage.php).
Adam
Adam
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
So originally it said
Code: Select all
phpc_root_path = './'Code: Select all
phpc_root_path = './calendar/'Adam