madchops Posted January 23, 2007 Share Posted January 23, 2007 I have a problem which I cannot figure out since the code works fine in all the other sites I have built. Even on test sites on the same server.Rundown:I have a modulated site and for an example I echo the variable $valid, which has a value of the member's id, and the vaiable $domain, which has a value of the site domain location (ex. etwdesign.com/airtaxijuice). These variables are echoed right before the header include as such:--------------------------------------------------------------------------<?$domain = $_SESSION['domain'];$valid = $_SESSION['valid'];echo "Valid: $valid ";echo "Domain: $domain ";include ("http://www.".$_SESSION['valid']."/includes/header.php");?>--------------------------------------------------------------------------Then in the header on the very first line I echo the same vairables as such:--------------------------------------------------------------------------<?echo "Valid: $valid";echo "Domain: $domain";?>--------------------------------------------------------------------------For some reason when it parses the echos before the header include echo fine. But the variable in the header don't come through. This prevents me from using "if" statements and other things within the header or footer includes. I have done this successfully in the past and I cannot for the life of me figure this out. If anyone has any ideas let me know.View the example at[url=http://www.etwdesign.com/airtaxijuice/register.php]http://www.etwdesign.com/airtaxijuice/register.php[/url]the valid variable will be empty unless you fill out the registration form, but the domain variable should always have the value of etwdesign.com/airtaxijuiceI will appreciate any suggestions. Link to comment https://forums.phpfreaks.com/topic/35326-header-and-footer-includes-wont-return-variables/ Share on other sites More sharing options...
genericnumber1 Posted January 23, 2007 Share Posted January 23, 2007 dont include files by url and you should be golden ;) Link to comment https://forums.phpfreaks.com/topic/35326-header-and-footer-includes-wont-return-variables/#findComment-166988 Share on other sites More sharing options...
madchops Posted January 23, 2007 Author Share Posted January 23, 2007 Thank You so much, I knew it was something small and basic. Link to comment https://forums.phpfreaks.com/topic/35326-header-and-footer-includes-wont-return-variables/#findComment-167533 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.