I am making a print page that will dynamically include a page which is passed in the URL. I am able to dynamically include the file, but the file path has a variable passed in it (ex: "page.php?var=22"). The include is giving me an error when it contains the variable. But without it, it is fine (ex: "page.php").
Any ideas?
Dynamic Include
Moderator: General Moderators
you can't pass GET style variables in an include statement. However the included file is run in the same context as the include call. So if you want to "pass" a variable named "var" to the included script simply do
the script in page.php can now use $var.
Code: Select all
$var=22;
include("page.php");