Pass value to an include file in php.
- by Muhammad Sajid
Hi,
How do you pass a parameter into an include file? I tried the following but it doesn't work.
include "myfile.php?var=123";
and in myfile.php, I try to retrieve the parameter using $_GET["var"].
include "myfile.php?var=123"; will not work. PHP searches for a file with this exact name and does not parse the parameter
for that I also did this:
include "http://MyGreatSite.com/myfile.php?var=123";but it does not also work.
Any hints? Thanks.