Jump to content


Photo

Including files using an id.


  • Please log in to reply
3 replies to this topic

#1 billshackle

billshackle
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 02 March 2006 - 08:16 AM

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



#2 Snip

Snip
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 02 March 2006 - 08:38 AM

Stringconcatenation is done by using '.'

<?

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

?>

#3 billshackle

billshackle
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 02 March 2006 - 08:50 AM

cheers pal,

Worked a treat.

#4 heckenschutze

heckenschutze
  • Members
  • PipPipPip
  • Advanced Member
  • 257 posts
  • LocationAustralia

Posted 02 March 2006 - 11:35 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users