I have a PHP script called customers.php that is passed a parameter via the URL, e.g.:
http://www.mysite,com/customers.php?employeeId=1
Inside my customers.php s
PHP includes are really includes; they attach piece of code from that location to this location.
PaulPRO’s answer most likely tells what you want to achieve, but also other variables would be usable in the included file. So if you define $foo = "bar";
in index.php and include layout.php after that line, you could call this $foo
variable in that layout.php file.
If you seriously want to pass an URL to the file, you can insert the URL into variable and in included file parse it with parse_url
EDIT: and yes, I do not suggest adding query params to actual include url as it starts to mess up with GET array and eventually you’ll just be confused what there should be and start smacking your head into wall.