Php using variables in include function
Posted: Sun Feb 03, 2008 3:20 pm
Hi
Sorry bit of a newbie here, I'm looking to declare a variable and then pass that variable into the include function.
Say for example I have an index page, which then links to various page, but those various pages use the same template.
The link carries a variable like page=test
So the template page loads and because I like to keep content separate from presentation given what I'm working on is a CMS solution is ideally something like this.
$test = $_GET['page'];
include "/images/" .$test. ".gif";
Does this make sense? I'm trying to use a variable as part of the include declaration, but being a newbie, I don't see to have hit the nail on the head yet.
Any help would be appreciated
Regards
Int3rc3ptor
Sorry bit of a newbie here, I'm looking to declare a variable and then pass that variable into the include function.
Say for example I have an index page, which then links to various page, but those various pages use the same template.
The link carries a variable like page=test
So the template page loads and because I like to keep content separate from presentation given what I'm working on is a CMS solution is ideally something like this.
$test = $_GET['page'];
include "/images/" .$test. ".gif";
Does this make sense? I'm trying to use a variable as part of the include declaration, but being a newbie, I don't see to have hit the nail on the head yet.
Any help would be appreciated
Regards
Int3rc3ptor