473,322 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Page Structure

I have recently constructed a website using a lot of php script (self
taught). I now wonder if I should have construted the site in a different
way.

The page contains a header (a.php) and left column (b.php) that remain
constant. Depending upon which heading is clicked in a menu row the user
gets different information up in the main site area (three different
versions of "c"). And a footer (d.php).

What I think I have done is loading in the entire site again for each
different menu heading. I load a variable according to which the contents of
(c) is called.

This is the blueprint of the structure I have used.

indexc1.php does the following
Load a.php (header code)
Load b.php (left column info)
Load m.php (menu bar)
sets $var to "elephants"
Load c1.php (specific text)
(if $var is "elephants" include elephanttext.php)
(if $var is "lions" include liontext.php)
(if $var is "tigers" include liontext.php)
Load d.php (footer info)

indexc2.php does the following
Load a.php (header code)
Load b.php (left column info)
Load m.php (menu bar)
sets $var to "lions"
Load c2.php (specific text)
(if $var is "elephants" include elephanttext.php)
(if $var is "lions" include liontext.php)
(if $var is "tigers" include liontext.php)
Load d.php (footer info)

indexc3.php does the following
Load a.php (header code)
Load b.php (left column info)
Load m.php (menu bar)
sets $var to "tigers"
Load c3.php (specific text)
(if $var is "elephants" include elephanttext.php)
(if $var is "lions" include liontext.php)
(if $var is "tigers" include liontext.php)
Load d.php (footer info)

So the only difference with each index file is the value of $var.

In the menu (m.php) the user can click the buttons marked "lions", "tigers",
or "elephants". (which loads in indexc1.php, indexc2.php or indexc3.php).
The problem with doing things the way I have is that the page is redrawn
everytime the user clicks on another heading in the menu.

I guess that I should be calling in a.php, b.php, m.php d.php just once and
then that the menu should just be changing the text displayed in the main
text area without redrawing the entire site. (Similar to a target tag in
frames).

How is this effect created with php?

Any help appreciated

Garry Jones
Sweden


May 10 '06 #1
4 1768
Garry Jones wrote:
I have recently constructed a website using a lot of php script (self
taught). I now wonder if I should have construted the site in a different
way.

The page contains a header (a.php) and left column (b.php) that remain
constant. Depending upon which heading is clicked in a menu row the user
gets different information up in the main site area (three different
versions of "c"). And a footer (d.php).

What I think I have done is loading in the entire site again for each
different menu heading. I load a variable according to which the contents of
(c) is called.

This is the blueprint of the structure I have used.

indexc1.php does the following
Load a.php (header code)
Load b.php (left column info)
Load m.php (menu bar)
sets $var to "elephants"
Load c1.php (specific text)
(if $var is "elephants" include elephanttext.php)
(if $var is "lions" include liontext.php)
(if $var is "tigers" include liontext.php)
Load d.php (footer info)

indexc2.php does the following
Load a.php (header code)
Load b.php (left column info)
Load m.php (menu bar)
sets $var to "lions"
Load c2.php (specific text)
(if $var is "elephants" include elephanttext.php)
(if $var is "lions" include liontext.php)
(if $var is "tigers" include liontext.php)
Load d.php (footer info)

indexc3.php does the following
Load a.php (header code)
Load b.php (left column info)
Load m.php (menu bar)
sets $var to "tigers"
Load c3.php (specific text)
(if $var is "elephants" include elephanttext.php)
(if $var is "lions" include liontext.php)
(if $var is "tigers" include liontext.php)
Load d.php (footer info)

So the only difference with each index file is the value of $var.

In the menu (m.php) the user can click the buttons marked "lions", "tigers",
or "elephants". (which loads in indexc1.php, indexc2.php or indexc3.php).
The problem with doing things the way I have is that the page is redrawn
everytime the user clicks on another heading in the menu.

I guess that I should be calling in a.php, b.php, m.php d.php just once and
then that the menu should just be changing the text displayed in the main
text area without redrawing the entire site. (Similar to a target tag in
frames).

How is this effect created with php?

Any help appreciated

Garry Jones
Sweden


Garry,

You can't do it in just PHP without using frames. The browser doesn't have the
option of only loading part of a page otherwise.

Your other choice would be to do it with some client-side language such as
javascript.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 10 '06 #2
Rik
Garry Jones wrote:
In the menu (m.php) the user can click the buttons marked "lions",
"tigers", or "elephants". (which loads in indexc1.php, indexc2.php or
indexc3.php). The problem with doing things the way I have is that
the page is redrawn everytime the user clicks on another heading in
the menu.
Because all those pages are almost the same, why not use a GET request?
index.php?var=lions etc.
I guess that I should be calling in a.php, b.php, m.php d.php just
once and then that the menu should just be changing the text
displayed in the main text area without redrawing the entire site.
(Similar to a target tag in frames).

How is this effect created with php?

Not, as already pointed out. AJAX can help you out on the client side. It
relies on javascript, and some visitors may have disabled that.
If the header/menu/etc. are decently written, and existing images are
cached, it should be hardly noticable though.

Grtz,
--
Rik Wasmus
May 10 '06 #3
"Rik" <lu************@hotmail.com> skrev i meddelandet
news:e3**********@netlx020.civ.utwente.nl...
If the header/menu/etc. are decently written, and existing images are
cached, it should be hardly noticable though.


See for yourself.

http://www.vasatrampet.se/

For each click on a menu heading the page is redrawn in msie and flashes.
However, its much smoother in firefox for some reason.

Comments appreciated

Garry Jones
Sweden
May 10 '06 #4
Garry Jones wrote:
"Rik" <lu************@hotmail.com> skrev i meddelandet
news:e3**********@netlx020.civ.utwente.nl...

If the header/menu/etc. are decently written, and existing images are
cached, it should be hardly noticable though.

See for yourself.

http://www.vasatrampet.se/

For each click on a menu heading the page is redrawn in msie and flashes.
However, its much smoother in firefox for some reason.

Comments appreciated

Garry Jones
Sweden


Garry,

That's only because IE is clearing the window before it starts parsing the page
for display. Firefox is doing it more efficiently. Not much you can do about
that end.

However, looking at your code, there are a lot of things you can do. I didn't
look at it in detail, but is all that JS necessary? And you are duplicating a
lot of styles inline. The result is your main page comes out to over 17K - you
could probably cut that in half with the proper use of style sheets.

Additionally, your images are over 180K. mak_205_160.jpg itself is 103K. You
should try to cut the sizes down. For instance, changing the jpeg quality of
this one file from 79% (your value) to 50% resulted in a file that was only
46.5K in size with no noticeable loss of quality.

You should be able to get the entire page size easily down to 70-80K, resulting
in faster loading time and less of a delay. You can get more hints on how to
optimize your pages in alt.html.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 10 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: BK | last post by:
I am writing a tiered inheritance structure in ASP.NET and would like opinions on the best way to accomplish the correct inheritance dynamically. The page structure is going to look similar to the...
6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
6
by: SF RVN | last post by:
Hmmmm.. a wee bit of a problem: Background default.htm has a left-aligned table serving as a 'navigation menu' and a right-aligned iFrame (named 'viewframe') serving as the 'target' for...
1
by: Roger Withnell | last post by:
My website has a dynamic navigation bar which the administrators of the site can design. It's structure is held in an SQL database. It is displayed on every page of the website. For a browser,...
27
by: Sune | last post by:
Hi! Pre-requisites: ------------------- 1) Consider I'm about to write a quite large program. Say 500 K lines. 2) Part of this code will consist of 50 structs with, say, no more than at most...
5
by: Hardy Wang | last post by:
Hi all: I developed a web site, it passed various testing internally. When I put this site in production, I receive some error reports from this site saying "the viewstate is invalid for this page...
7
by: dubing | last post by:
Hi, Given a page source, is there any tool that can make a sketch of the page structure? Our template is DIV based. It's easy to get lost in so many DIV's. Say, <div id="container"can include...
0
by: richard.haber | last post by:
I have a situation where there are two controls on the master page: a tree with a menu structure (whose content and structure is customizable by each user) and a menu control which displays the...
5
by: Annie | last post by:
hello guys, I have a scenario that I am confused about ... I have a number of pages which are using a Master page ... Then I have seperate Footer user control that can reside in master page...
2
by: Willy Van den Driessche | last post by:
Hello, I am writing (Yet Another) Content Management Application. To make it easier for the end-users, I would like to retrieve the structure of the website. To do this, I would like to "walk...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.