corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » any web designers here???


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author any web designers here???
KITcorsa
Member

Registered: 16th Dec 02
Location: Middlesbrough
User status: Offline
12th Jul 06 at 16:39   View User's Profile U2U Member Reply With Quote

if so i have a question as something is pissing me off and i cant for the love of it get it to work!!!!!!!!!

the question is about php and mainly the echo statment.

what im doing is building a site using css etc etc etc

each page has trhe same headers footers and navbar etc, basically only the ifo on the pages changes.

simple enough ya think just copy the code onto everypage and add the info! yes easy! but what happens when i need to add a new button to nav bar, i have to go through each page and cheage each page and on a 30 page site its just to time consuming.

so here where the php comes in

use a echo statement and and have all the pages use the same information for a seporate folder.

Also i dont want to use a database on this site before you think of that!!!!

follow??

thing is i dont have a clue where to start, i can get the echo statment to work on a page is the echos are stated at the top of the page (but this does not cut down the update time at all so pointless) but i would like the statments in a seport folder so all i do is change the file and it changes the whole site. i know this can be done biut i dont know how!

if anyone here knows how please let me know please or if you know a free site on net that will show me!!

thanks alot!

ps this is for a piece of college/uni work but they didn't teach us this but ifs for extra credit
Eck
Premium Member

Avatar

Registered: 17th Apr 06
Location: Lundin Links, Fife
User status: Offline
12th Jul 06 at 16:41   View Garage View User's Profile U2U Member Reply With Quote

Best to u2u ian this sort of thing mate.
Laney
Member

Registered: 6th May 03
Location: Leeds
User status: Offline
12th Jul 06 at 16:44   View User's Profile U2U Member Reply With Quote

When I did this I created a template, then included the content, surprisingly using includes!

for example:

index.php?section=news would include the news content.

Hope that helps?
poole
Member

Registered: 12th Oct 03
Location: Sheffield, UK Drives: 2.5 v6 Calibra
User status: Offline
12th Jul 06 at 16:55   View User's Profile U2U Member Reply With Quote

Send me a PM with more information about what you want and ill help you out.
Alex16v
Member

Registered: 30th Jun 06
Location: Chester Drives: Civic ep3 final edition
User status: Offline
12th Jul 06 at 16:59   View User's Profile U2U Member Reply With Quote

If its the stylesheet your just including in each page, just save it as style.css, then use the import@ /style.css to include it in each page. Google css includes, or try pixel2life.com for help.
MikeLamb
Member

Registered: 23rd Sep 03
Location: Crowthorne Drives: Veccy SRI
User status: Offline
12th Jul 06 at 17:26   View User's Profile U2U Member Reply With Quote

put this in index.php:
<?
include "header.php";
include $_GET["page"].".php";
include "footer.php";
?>


make a file called header.php, put the header in there
make a file called footer.php, put the footer in there
make all the content pages, e.g page1.php, page2.php etc etc

access the pages like this:

http://domain.com/?page=page1

update header & footer.php and every page will update.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Online
12th Jul 06 at 19:08   View Garage View User's Profile U2U Member Reply With Quote

You might want to regexp the variable to remove anything that isn't a-z.

For the record, here's the policy on u2u'ing me for technical advice - http://www.corsasport.co.uk/board/viewthread.php?tid=189319

DON'T u2u me technical questons
Dom
Member

Registered: 13th Sep 03
User status: Offline
12th Jul 06 at 19:16   View User's Profile U2U Member Reply With Quote

Personally i would put the headers and footer info into a php function, then include that in all of your pages and just print/echo the data - ie:

code:

create a "functions.php" -

function heads() {
strDat = "<HTML><Title>BOB</Title>";
return strDat
}

function foot() {
strDat = "</HTML>";
return strDat
}

Then in say news.php -

include "functions.php";
echo heads();
(blah blah blah info)
echo foots();



Thats how i do it when doing things like this, also means that all my functions are in one place so one file.
However, mikes idea is probably the most straight forward as you dont have to include things all the time etc

[Edited on 12-07-2006 by Dom]

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Please read this post!!! Thanks mestonian Classifieds 9 1167
10th May 03 at 17:28
by viera
 
Web Site Designers Scott General Chat 14 1022
28th Apr 03 at 09:28
by Cosmo
 
Website Plug - What do ya think J1 General Chat 4 788
9th May 03 at 14:53
by J1
 
Major life decision vibrio General Chat 134 4167
11th Jun 03 at 19:49
by CORSA NUT
 
Ordered the aero kit for me cooper s today Dr Pepper General Chat 27 2029
26th Oct 04 at 08:36
by 3CorsaMeal
 

Corsa Sport » Message Board » Off Day » Geek Day » any web designers here??? 28 database queries in 0.0127079 seconds