I want the content on a page of my website to appear on two different pages. At the moment i have copied and pasted the content into the code of the files but this means that if i want to edit the content then i have to do it twice, it also means that i am taking up twice as much space. I tried to put the content into a PHP variable then just echo the variable on the second page but that doesnt work. Is there a way to have a cross file variable so i only have to put the content on one page then just put a variable on the other?
P.S: please bear in mind I am relatively new to PHP so when writing answers keep this is mind
02-19-2012, 04:49 PM
I think what you want is to use a php include. It allows you to have a common part of your site (e.g. like the nav, or the footer) in a separate file and you can just 'include' it into all of your other files. I may have misinterpreted what you meant, sorry if I have.