Jump to content

Pass Variable To Include


roundcorners

Recommended Posts

Hi all, I am using includes and passing variables to the index.php page and using a switch statement to define which include is pulled in depending on which link is activated...this I can do.But when I try and pass a variable to an include to change the include it pulls in I find that it cannot be done, I have searched for an answer, but I have had no luck, could someone please give some help??Thank you.

Link to comment
Share on other sites

Any sample broken code? Maybe you're just having a syntax error.It should look something like

include $var . '.php';

(assuming the file you wanted to include has the same name before its extension as the variable $var)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...