Jump to content

Archived

This topic is now archived and is closed to further replies.

billshackle

Including files using an id.

Recommended Posts

I have a script which is unique to each entry in my database. So what i am trying to do is name the scripts according to there ID and then include them on my page.

E.g. i want to do something like <? include 'pages/pages<? echo $id ?>.php' ?> but i can't seem to figure it out, any idea's?

Cheers

Share this post


Link to post
Share on other sites
Stringconcatenation is done by using '.'

<?

$next_page="pages/page".$id.".php";
include "$next_page";

?>

Share this post


Link to post
Share on other sites
Remember that quoting is for strings, no need to quote a variable.
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
[code]include "$next_page";[/code][/quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.