Forum Moderators: coopster

Message Too Old, No Replies

Question about including ,txt etc,

         

Simone100

2:33 am on Sep 9, 2006 (gmt 0)

10+ Year Member



Hi, this is some php that includes what kind of page I put in. In the following case it includes a small .html page. Is there a way to make it more generic?

So that it will include any kind of file so I don't have to type in
.html or .txt etc.?

$includepage = "page" . $page_no . ".html";

Thank you very much! Simone

jatar_k

3:55 pm on Sep 9, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



there isn't really, except by changing your logic

I assume $page_no comes from somewhere, possibly a db, you could also store the extension along with the page number and then the include could use 2 vars instead of one