edit patrikG: use a descriptive title for your post and don't use CAPS or bold.
I HAVE THIS CODE:
<? include('include/promo.inc.php?pos=t'); ?>
AND THIS ERROR:
Warning: Failed opening 'include/promo.inc.php?pos=t' for inclusion
edit patrikG: use a descriptive title for your post and don't use CAPS or bold.
help with include please
Moderator: General Moderators
-
Cryptkeeper
- Forum Newbie
- Posts: 17
- Joined: Wed Nov 10, 2004 3:05 am
when you include a file you must pretend that all the code from the included file 'magically' appears from where you include it.
you are not passing variables to it.
[php_man]include[/php_man]
btw: don't be supprised if a mod say use the php tags for code. that little button that says 'php' on it
Code: Select all
<?php
$pos='t'
include('include/promo.inc.php');
?>[php_man]include[/php_man]
btw: don't be supprised if a mod say use the php tags for code. that little button that says 'php' on it
I was aware that you could pass variables if you used the whole URL, eg:
I could however be wrong, I havent checked this out.
Code: Select all
include('http://www.foo.com?pos=t');- protokol
- Forum Contributor
- Posts: 353
- Joined: Fri Jun 21, 2002 7:00 pm
- Location: Cleveland, OH
- Contact:
When including local files, you can return values from an [php_man]include[/php_man](), but you may need to think of a better way to get variables set in them. Since [php_man]include[/php_man]() simply includes all the contents of the file into the place that it is called at, you can set variables above it which will be in the scope