<?php
$city = $_GET["city"];
$prov = $_GET["prov"];
$file = "citycountdetails.php?city=".$city."&prov=".$prov."";
?>
<?php include $file; ?>
Warning: include(citycountdetails.php?city=Halifax&prov=NS) [function.include]: failed to open stream: No such file or directory in ….
Not sure what I am doing wrong…
Thanks
You cannot include a file with parameters in there I’m afraid!
Those parameters are only for http requests. php includes do not launch http requests, they just include local files from the file system.
There are several ways to achieve what you’re trying to do:
access $_GET[“city”] and $_GET[“prov”] from within citycountdetails.php.
This is the quick ugly method,and leads to quite a bit of dependency, but its not bad at least.
declare $city and $prov, and access it from citycountdetails.php (using globals).
This is probably the worst way to do it, so don’t do this. 😀
create a functions file with methods to retrieve those parameters
Probably the easiest thing you can do now, without all the bad side effects.
functions.php
Your file
city count details.php