News:

Click here for Toll-Free Service for your business starting at $2.00 per month

Main Menu

include

Started by Evilsprouts, March 10, 2006, 08:58:08 PM

Previous topic - Next topic

Evilsprouts

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

brainiac744

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";

Evilsprouts

#2
[edit]problem solved[/edit]