Hi,
You are calling the file in the local filesystem. This method does not support parameters.
= "Show.php?ShowID=1";
= file_get_contents();
echo ;
If you use a http wrapper for your function call you will be able to pass parameters
= "http://www.domain.tld/Show.php?ShowID=1";
= file_get_contents();
echo ;
Be careful with this function and ensure that you don't have allow_url_fopen enabled in your php.ini file, although this is generally disabled on webhosts who know what they are doing.
Personally, I'd use cURL to include file contents to a variable although you may have to enable cURL on your server for this...
<?php
function includeFile($url) {
// Initiate the curl session
$ch = curl_init();
$timeout = 5;
// Point curl to the irl we want
curl_setopt($ch, CURLOPT_URL, $url);
// Set some cURL options
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// Get the file contents
$file_contents = curl_exec($ch);
// Close the curl session
curl_close($ch);
$content = implode('', array($file_contents));
// Return the content
return $content;
}
$str = includeFile("
http://www.domain.tld/Show.php?ShowID=1");
?>
You could also try something like this to just initialise your variable before your call file_get_contents, then tell show.php to do something if the $showID variable isset...
<?php
$showID = 1;
$url = "Show.php";
$str = file_get_contents($url);
echo $str;
?>