Dev Shed Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDev Shed Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 27th, 2002, 12:55 AM
killerasp killerasp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 29 killerasp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Web site layout question

Im trying to develop a more dynamic site than what im used it. But im unsure how to layout the various functions of the site. Ive seen some sites where they have a login.php that controls login or logout. Or news.php to display the news and comments about it submitted by users. Is there a standard design i should i follow? are they websites or websites that talk about this?

Reply With Quote
  #2  
Old February 27th, 2002, 01:27 AM
Datamike's Avatar
Datamike Datamike is offline
Web Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2001
Location: Finland
Posts: 719 Datamike User rank is Corporal (100 - 500 Reputation Level)Datamike User rank is Corporal (100 - 500 Reputation Level)Datamike User rank is Corporal (100 - 500 Reputation Level)Datamike User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 27 m 33 sec
Reputation Power: 9
I don't think there are any standard ways of generating your site layout but there are common tricks that many people use. One that I've used often is to have one file that is include on every page. Like site.php and it contains the main header of the page: your logo and other stuff that are part of the site in all pages. They use this in php.net. There there is the piece-by-piece method. What you do is you generate certain file, like header.inc, menu.php, and maybe footer.php. I'm thinking you guess what each of these files does. The main body of the site will then be the one that the user requests from in url, like index.php or frontpage.php. Then you just link these into one and you have a very dynamic site.

These are just few. I hope this helped you out a bit.
__________________
-- Tomi Kaistila
-- Developer's Journal

The more you learn, the more you know.
The more you know, the more you forget.
The more you forget, the less you know.

Reply With Quote
  #3  
Old February 27th, 2002, 04:25 AM
binky's Avatar
binky binky is offline
Gerbil
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2001
Location: In a Rotastak
Posts: 1,763 binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 22 h 12 m 52 sec
Reputation Power: 18
Yeah, that's usually the way. These days people tend to have files that go like:


-----------
header
-----------
content
-----------
footer
-----------

That's no surprise. All you need is a 'header.txt' and a 'footer.txt' that is the standard menu bar and copyright notice then you just include them.

<?php
include ("header.txt")
?>
My content goes here
<?php
include ("footer.txt")
?>

Often (usually) the central bit is devided into two or more tables. One of these is a dynamic include, the other is the content of the page. Consider MS's site, the navigation bar down the left being an include that responds to what page the user is on (and shows content specific links), the right section being the actual content.

What you really want to aim for is the very minimum of information being hardwired to the page. The header and footer themselves could be php files that draw their links from XML files (though people tend to like static links on headers and footers).

What I do then, cos I could preach and be talking not from a 'from-practice' viewpoint. I put my data in XML-like files and have php serve up the contents when a user clicks a link. The links themselves (except for the index.html page) are generated by PHP cycling through folders and files to extract the relevent data. It's complicated at first, but then the benefits are great afterwards..

Reply With Quote
  #4  
Old February 27th, 2002, 10:16 AM
andnaess andnaess is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2001
Location: Oslo
Posts: 1,516 andnaess User rank is Private First Class (20 - 50 Reputation Level)andnaess User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
I normally use a single page for everything, so everything in my sites are accessed using something like:
http://www.example.com/?page=foo&action=bar

index.php is then responsible for building the entire page using includes etc. Normally I also have index.php open a connection to my DB, include common classes and functions... etc...

A more important issue is probably how you work. It's easy to start by writing some code for one particular part of the site, then you realize that the same (or almost the same) code is needed in some other page. You might think that "Agh, stupid me I should have thought about that", but don't -- planning those kinds of things are hard. The key is to refactor , all the time. You see some code you've written before; generalize it, you see the generalization being to specific at some later state, so you generalize again.

Refactoring isn't just about merging, it's also about splitting up. For example, a piece of code that grows large will be harder to read, harder to comprehend, and harder to maintain. So you split it up into more manageable parts.

It's so tempting to not do it because in some cases it will lead to extra work. For example, you've written a display routine which prints out some data about a user. Then in some other page you again display data about a user. After writing this you realize that the two presentations are very similiar, and could easily be refactored into a single piece of code, but since you it's now working the way you want it to, you don't do the extra work.

Then some weeks later, the layout for the presentation of users changes. So you have to change it both places, again, you only realize this after doing the job so you don't care to refactor again. Then another change comes along... etc...

Of course, that's a very simple example, but getting into the habit of refactoring is a Good Thing[TM].
__________________
--
Regards
André Nęss

Puritanism: The haunting fear that someone, somewhere may be having fun

Reply With Quote
  #5  
Old February 27th, 2002, 01:55 PM
killerasp killerasp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Posts: 29 killerasp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the tips guys.
anyone else with more website development experience, please give me some insight.
thanks ahead

Reply With Quote
  #6  
Old March 8th, 2002, 11:54 PM
TommyWillB's Avatar
TommyWillB TommyWillB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: ol' Gay S.F.
Posts: 94 TommyWillB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 39 sec
Reputation Power: 7
Just remember that you are building for the ease of the visitors to your site.

When it comes to site logins, don't do anything radical. If the process is not clearly spelled out and similar to other sites (ebay, Amazon, etc.) then the users will be more afraid of it.

The thing I try to do is to ease folks in a little at a time. Ask for bits of informaiton (your birthday in exchange for a horiscope) instead of having them fill out a long registration form.

Don't actually make users creat an acutal username/password login until they get to the point of wanting to modify the user profile you've already built up for them...
__________________
TommyWillB
Apple Power Mac G4 867mhz, 1GB RAM nVIDIA geforce 2 (TwinView) Apple Studio 17" flat screen + Compaq 17" 2x60GB ATA drives
jeffntom.com hosted on Mac OS X 10.3.4 / Apache 1.3.29 / PHP 4.3.2

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDev Shed Lounge > Web site layout question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway