The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Simple PHP include statement

I'm not very familar with PHP in terms of code writing, so I'm curious about something.

On my website, www.bui4ever.com, I'm using <? include('name of document.txt'): ?> in place of where I change information frequently. I then input the information into a text document and link it to that line. I do it so when I alter the text, I don't have to risk messing with the layout. Is there any forseeable problems I may run into in the future doing it this method? I don't really need a database or anything fancy like that. Thanks!

No I don't really want a CMS. Already did Postnuke. I want a website fully created by me. I was just figuring a way to make some changes to certain areas more efficiently. For example, the side navigation on the index page is the same as the sub menu on those 10 pages. In the past, to add one new menu block, I would have 10 pages to update. By making it into a txt doc and calling upon it with the php line, I now only have to change 1 doc for 10 pages. Basically the same idea as an external style sheet. I just want to make sure that that PHP line isn't going to cause problems on different browsers, or other issues.

If you start passing variables to this include() function, make sure you cleanse that data thoroughly to prevent users from opening files they shouldn't be. You can use regular expressions to verify that or, if there are only a few options, put those options into an array and make sure that the variable passed is in that array.

If you start passing variables to this include() function, make sure you cleanse that data thoroughly to prevent users from opening files they shouldn't be. You can use regular expressions to verify that or, if there are only a few options, put those options into an array and make sure that the variable passed is in that array.

It didn't sound like she was going to be using any variables in the include; I think she just wanted to seperate her content from her layout.

EDIT: I also don't think there is going to be any user input to clense.