FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: Evilsprouts on March 10, 2006, 08:58:08 PM

Title: include
Post by: Evilsprouts on March 10, 2006, 08:58:08 PM
Hiya,

I'm writing a little script for a friend on a different host and I'm trying to include from a variable for example
<?php include("$page"); ?> where $page = add.php but it doesn't work.

It thinks I'm trying to include ".php" rather than "add.php".

Could it be to do with php version or something?

Thanks
Title: Re: include
Post by: brainiac744 on March 10, 2006, 09:05:24 PM
If you use a variable like that you need to lose the quotes, like this:

<?php include($page); ?>


Also, be sure that $page IS declared with quotes, like this:

$page = "add.php";
Title: Re: include
Post by: Evilsprouts on March 10, 2006, 09:19:40 PM
[edit]problem solved[/edit]