cstegner Posted April 20, 2006 Share Posted April 20, 2006 I have redone my whole site in CSS instead of tables and made it XHTML compliant. So now I wanted to just take the main design and chop it into two pieces; top.php and bottom.php.Then I <?php session_start();include("http://www.bigornot.com/inc/top.php");?>content here<?include("http://www.bigornot.com/inc/bottom.php");?>However none of the sessions appear to be carrying over to the files I am including. General stuff like $username. How do we get past this? Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted April 20, 2006 Share Posted April 20, 2006 By waht I have studied all the superglobal variables, always hold the variables in them, You can probably change around variable information with basic string functions, and replace functions, but you would have to find the position of the variable first.what you could try is saving it as a function in an external php file, and then running the function on the page you want.[a href=\"http://www.hudzilla.org/phpbook/read.php/4_18_0\" target=\"_blank\"]http://www.hudzilla.org/phpbook/read.php/4_18_0[/a]on this site, it cuts down the informaiton on superglobals and there usage a lot better than www.w3schools.com and the manual at php.net so maybe you can find something there.[a href=\"http://www.hudzilla.org/phpbook/read.php/2_6_15\" target=\"_blank\"]http://www.hudzilla.org/phpbook/read.php/2_6_15[/a]also this page exactly gives detailed information on including files, and splicing up file information.Or you can take the top portion, put it in top.php, the bottom put it in bottom.php and call each one where they are needed in the main document.Or maybe storing the variable you are trying to carry over into a function in an external file like I stated earlier, but then use the function in the file you are wanting to carry if over for, or just reset the variable.some of this sounds wierd because I misunderstood your post at first but hopefully something here can help.I also notice a database insert error on the section[a href=\"http://www.bigornot.com/inc/bottom.php\" target=\"_blank\"]http://www.bigornot.com/inc/bottom.php[/a]near the bottom of the page, maybe that has something to do with it,.also the variable for username should be stored in one of the superglobals I am not sure which one it said, put that variable should be able to be moved throughout the same server seamlessly, by what I have read.hope some of this helps. Quote Link to comment Share on other sites More sharing options...
cstegner Posted April 20, 2006 Author Share Posted April 20, 2006 duh figure it out....Since I was calling it with the entire url it must have rendered the include before including it.So I just used a server path and it works perfect.Thanks for the help though.-Chris Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted April 20, 2006 Share Posted April 20, 2006 your welcome Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.