Weborum Webmaster Forum > PHP
Help - Search - Members - Calendar
Full Version: PHP
Weborum Webmaster Forum > Web Page Design > PHP
circular
Need some help on how to apply this and do I need another programme to make it function?
I do my own html in Notepad and would like to do the following:
I have a website where I am constantly updating a noticeboard portion of it. There are quite a number of pages on the site and all have this noticeboard. I would like to be able to change the noticeboard content in one place only but for the changes to show on all the related pages.

Elsewhere in this forum are some instructions how to do this but when I followed them it didn't work!

To try it I used the following
<?php
include "menu.php";
?>

on one of the webpages, in the place where I want the information to display. I made another page with the noticeboard content and called it menu.php - but as I said it didn't work! I do not see how I can change the suffix of the actual webpage to .php as it then doesn't keep the html suffix? Doesn't work either way. What am I missing please?
The website I am referring to is: http://www.hillheadsc.org.uk
leo
Hi circular, welcome to weborum smile.gif

try it like this, the page does need to have .php to work, also make sure your host provides php support (most paid ones do)

<?php
include ("menu.php");?>
leo
also make sure the path to the file is correct, is it in the same folder?
Timo
The page calling the other page, aka your main page, has to end with .php.

Don't worry, just change your index.html to index.php and delete your index.html... When someone visits your page http://www.hillheadsc.org.uk/ it will automatically go to the .php like it would the .html.

-Tim
circular
Hello Tim

That worked OK but of course have to change the link on each page to index.php No problem with that.
However the menu.php doesn't show up on the page? I have checked with the server and its OK to use PHP
What next?
thanks
Timo
you have <?php include 'menu.php';?>
The file is named index.php
And the other file is named menu.php?

Try putting just text in menu.php, it should show up.

-Tim
circular
Its working!!

I hadn't uploaded it and then I wasn't careful enough with changing it to menu.php. Notepad insists on adding .txt afterwards - you have to click on all files to remove the txt! Anyway many thanks - going to save me a lot of bother now and can make the noticeboard in the same way!!
Great! biggrin.gif
Timo
haha goodluck!
-Tim
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.