I've been searching for hours on my problem and have found nothing that works, so this post is my last-ditch effort.
I've got index.php that will be used multiple times (over 100) on the site.
I'm using the request_uri to get the subfolder title of the product, then get a text file by that name. This works perfectly, no problems.
The only code on index.php is:
[size=2]<?php
$uri = $_SERVER['REQUEST_URI'];
list($domain, $subfolder1, $subfolder2, $pagename) = split("/", $uri);
$myFile = "http://www.mygreatsite.com/assets/products/" . $subfolder2 . ".txt";
$fh = fopen($myFile, 'r');
$title = fgets($fh);
$sku = fgets($fh);
$price = fgets($fh);
fclose($fh);
?>
<?php include("http://www.mygreatsite.com/full/path/to/include.php") ?>[/size]
The include file is a template page to show products with php and html, complete from <html> to </html>. It works just fine, everything shows up how it should. However, any variables I have set in the index.php will not pass to the include file.
I've tried sessions and that doesn't seem to work, either.
If I put:
[size=2]<?php echo $title; ?>[/size]
anywhere in my include page, nothing shows up. It is blank.
From everything I've read, it is stated that variables (or strings) should always pass through to include files, whether global or not.
Am I missing something?
I'm wondering if it's my hosting provider, we had some other PHP issues with an Image Resize script only working in site root and not in folders.