Jump to content

A way to edit...


barkera

Recommended Posts

Hi, I hae a website where I have one thing that appears on every page of the website (just text) is there anyway in PhP to run a seperate single file that I can edit which will change all of the pages? and if so how? or is there a better language to do it in? Thanks.

Link to comment
Share on other sites

Either include() or require()The difference:If the file fails to load, it will just issue warnigns with include() and the rest of the page will still load.With require() if the file fails to load, the whole page won't load.<?phpinclude("the_file_to_include.extension");?>

Link to comment
Share on other sites

Right, well I added that code in where I wnated the file and named the file and stuff, but nothing shows up where the code is on the page, heres what the php file has:<html><body>The server is Currently: OFFLINE</body></html>thats the file i'm linking to from all the pages and nothing shows up. What have I done wrong?

Link to comment
Share on other sites

Oh, so that's the file you want to include into other pages?Well I'll highlight in red what to remove<html><body>The server is Currently: OFFLINE</body></html>If you put those tags in the file, then they'll be included in the other pages and you'll have 2 sets of the game tags.Put that in somefile.extension and then use include("somefile.extension"); in the other pages.If it still doesn't work, then can I see how you included it in the other pages?

Link to comment
Share on other sites

that might be the problemphp only works on a server, as its a server-side language. unless you got a server installed on your computer, then it wont work.you need to upload the files to a server for php to take effect.:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...