Forum Moderators: coopster
&var = "filename";
<?php include "http://www.mysite.com/".$filename;.".php";?>
I've also tried it without the semi-colon after the filename.
What am I doing wrong here?
Thanks
<?php include "http://www.mysite.com/".$filename.".php";?>
if you want php code included, then include via local path (i.e. server path)
<?php include "/home/users/mysite.com/".$filename.".php";?>
Your suggestions are working fine with the syntax on the include.
The problem seems to be that none of the variables are even passing through to the header include after they've been assigned in the index file. This is strange since in the files in the root directory this seems to work without a hitch.
The files I'm working with here are 2 directories down from the main folder. The folders all have index files and I'm trying to assign the variables at the beginning of the index file and then call the header file, where all the real code begins. The php in THAT file seems to work fine except it won't recognize any of the variables from the parent file.
As I said before, this setup seems to work fine for files in the root directory, but not here. Any ideas?
Here index.php WILL see $var, as it is including via php parser
$var = 123;
<?php include "/home/mysite.com/index.php";?>
If you want to include with "http://" (like in first example) then try passing vars like this:
<?php include "http://www.mysite.com/index.php?var=123";?>