views:

14

answers:

1

Hello,

I have a index.php file that will include several external files:

"content/templates/id1/template.php" "content/templates/id2/template.php" "content/templates/id3/template.php" etc.

All these files are loaded dynamically into index.php (it reads all folders inside "templates" directory and then includes every "template.php" file).

I want to make "template.php" to have the same code in all the "id1,id2,id3" folders, BUT to load values from index.php depending in which folder it stays..

How can I do that? Thank You!

A: 
Pekka
Had a tiny typo in it, now corrected.
Pekka
Thank you so much! It's a hard life to be a newbie like me :D
Adrian M.
You're welcome, no problem.
Pekka
Oh one more question please..How will I write the code to load from index.php let's say the value of $id1_title (the "id1" is same as the folder where it's placed)?
Adrian M.
Found it on About.com$test = "success";$open = "$";$close = ";";$primary = "test";$ID = "$open$primary$close";echo $ID;Thanks again Pekka!
Adrian M.