By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,118 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,118 IT Pros & Developers. It's quick & easy.

Help with approach...

P: n/a
I could use a shove in the right direction...

I'm using the Dreamweaver MX suite to build a website for my business. At
first I threw
something together quickly just to get going. I now need to replace that
with something more refined. It seems that using PHP would be a part of
that.

I quickly learned that frames are problematic. I'm also reading that using
tables (for layout) isn't the best idea either. And, then, PHP and DHTML
came to the foreground as technologies I might need to utilize/understand.

The proposed site is relatively simple. Nav bar on top. Menu on the left.
Content front and center. Pretty standard stuff. The question is about
"best practices" for creating such an animal and making it so it is
reasonably easy to maintain.

I've seen PHP include() examples for inserting common elements (nav bar,
menu?) on every page without having to laboriously hand code them. I'm also
told that I might consider using DHTML instead, or in combination with, a
PHP approach. Of course, there's also CSS for the actual formatting.

I find myself going in circles without finding a clear path to follow. Can
someone offer a birds-eye view of what a sensible approach might be and
where
I would use each technology? I've setup a local Apache server with PHP and
mySQL ready to go.

For a look of where I want to go with the site you can go to
http://martin.ecinemasys.com/ where I've placed my latest experiment --in
embryonic stages.

Thanks,
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Euredjian

To send private email:
0_******@pacbell.net
where
"0_0_0_0_" = "martineu"

Jul 17 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
"Martin Euredjian" <0_******@pacbell.net> wrote in message
news:bh******************@newssvr29.news.prodigy.c om...
I could use a shove in the right direction...

I'm using the Dreamweaver MX suite to build a website for my business. At
first I threw
something together quickly just to get going. I now need to replace that
with something more refined. It seems that using PHP would be a part of
that.

I quickly learned that frames are problematic. I'm also reading that using tables (for layout) isn't the best idea either. And, then, PHP and DHTML
came to the foreground as technologies I might need to utilize/understand.

The proposed site is relatively simple. Nav bar on top. Menu on the left. Content front and center. Pretty standard stuff. The question is about
"best practices" for creating such an animal and making it so it is
reasonably easy to maintain.

I've seen PHP include() examples for inserting common elements (nav bar,
menu?) on every page without having to laboriously hand code them. I'm also told that I might consider using DHTML instead, or in combination with, a
PHP approach. Of course, there's also CSS for the actual formatting.

I find myself going in circles without finding a clear path to follow. Can someone offer a birds-eye view of what a sensible approach might be and
where
I would use each technology? I've setup a local Apache server with PHP and mySQL ready to go.

For a look of where I want to go with the site you can go to
http://martin.ecinemasys.com/ where I've placed my latest experiment --in
embryonic stages.

Thanks,



What's wrong with using tables?
You do also realise that you are opening a big can of worms getting into
database driven sites. Not that they aree hard to implement, but it will
take a fair amount of time to get efficient at PHP coding.
I would suggest that if you are going to learn PHP, get rid of MX, or at
least use it in code view. You will find de-bugging alot easier if you
actually know what the code looks like.

Are you learning for a job in the industry or just for a single site?
If the latter, it may be worth evaluating how much your time is worth, and
get a pro to do the job.
Much easier, less headache and better sleep :)

Regards
Richard Grove
01892 546979
http://shopbuilder.org - ecommerce systems
Become a Shop Builder re-seller:
http://www.affiliatewindow.com/affil...ls.php?mid=611
http://www.affiliatewindow.com/a.pl?590

Jul 17 '05 #2

P: n/a
"Richard Grove" wrote:
What's wrong with using tables?
Not entirely sure. I've seen all sorts of sites and posts that say that
using tables for layout should be avoided in favor of CSS.
You do also realise that you are opening a big can of worms getting into
database driven sites.
Yup. I won't be the one doing the db-based site. I just want an
incremental step up at the moment. From what you say it sounds like I
should just use tables, do it up and move on.

Have you seen typo3 (www.typo3.org)? Any thoughts?
Are you learning for a job in the industry or just for a single site?


Single site at the moment. Any other site would be a personal hobby. This,
in the long run, will be better off in the hands of pro's, of course.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Euredjian

To send private email:
0_******@pacbell.net
where
"0_0_0_0_" = "martineu"
Jul 17 '05 #3

P: n/a
jn
"Martin Euredjian" <0_******@pacbell.net> wrote in message
news:xI******************@newssvr29.news.prodigy.c om...
"Richard Grove" wrote:
What's wrong with using tables?
Not entirely sure. I've seen all sorts of sites and posts that say that
using tables for layout should be avoided in favor of CSS.
You do also realise that you are opening a big can of worms getting into
database driven sites.


Yup. I won't be the one doing the db-based site. I just want an
incremental step up at the moment. From what you say it sounds like I
should just use tables, do it up and move on.

Have you seen typo3 (www.typo3.org)? Any thoughts?
Are you learning for a job in the industry or just for a single site?


Single site at the moment. Any other site would be a personal hobby.

This, in the long run, will be better off in the hands of pro's, of course.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Euredjian

To send private email:
0_******@pacbell.net
where
"0_0_0_0_" = "martineu"


Until all browsers support CSS 100%, I'm going to keep using tables and only
use CSS for styling.

My .02.....
Jul 17 '05 #4

P: n/a
I noticed that Message-ID:
<D2*********************@twister.tampabay.rr.com > from jn contained the
following:

Until all browsers support CSS 100%, I'm going to keep using tables and only
use CSS for styling.


According to W3 you should only use tables for tabular data and not for
layout. Failing that, all tables should linearise, ie make sense when
read line by line such as in a text reader. It's an accessibility
thing. The CSS evangelists get quite passionate about it.

The process they recommend is that you first write the content and then
mark up the html (headings, subheadings, paragraphs etc) and use CSS to
apply the style and formatting.

Please note, I'm not saying /I/ do this all the time.

See http://www.csszengarden.com/

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #5

P: n/a
In article <22********************************@4ax.com>,
Geoff Berrow <bl******@ckdog.co.uk> wrote:

:According to W3 you should only use tables for tabular data and not for
:layout. Failing that, all tables should linearise, ie make sense when
:read line by line such as in a text reader. It's an accessibility
:thing. The CSS evangelists get quite passionate about it.

This gets a bit OT here, I know, but:

I recently had to lay out a chapter from the Bible. I tried it first
using divs and CSS, didn't like the look. I tried an ordered list and
CSS, which you'd think would be perfect for numbered verses from the
Bible, right? Nah. I couldn't get the look I wanted. So I put it in a
table (and CSS), each verse is a row, the number and text are separate
cells in the row. It does exactly what I want, I can style the content
any old way it pleases me.

So, what is tabular data, I guess is my question?

Anyway, last I heard from the CSS/HTML purists was you shouldn't use
multi-syllable words in your content because stupid people won't
understand and you don't want to alienate 88% of your possible viewers
do you, User-Agent 99?
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.
Jul 17 '05 #6

P: n/a
I noticed that Message-ID:
<Wa**************************@nr-tor01.bellnexxia.net> from Warren Oates
contained the following:
This gets a bit OT here, I know, but:

I recently had to lay out a chapter from the Bible. I tried it first
using divs and CSS, didn't like the look. I tried an ordered list and
CSS, which you'd think would be perfect for numbered verses from the
Bible, right? Nah. I couldn't get the look I wanted. So I put it in a
table (and CSS), each verse is a row, the number and text are separate
cells in the row. It does exactly what I want, I can style the content
any old way it pleases me.
I'm not a purist, but it sounds like your table would linearise just
fine anyway.
So, what is tabular data, I guess is my question? I think it's data that could have column headers and row headers. Since
you have column headers of 'verse number', and 'text' and a row header
of 'verse' then I'd say you were working with tabular data.
Anyway, last I heard from the CSS/HTML purists was you shouldn't use
multi-syllable words in your content because stupid people won't
understand and you don't want to alienate 88% of your possible viewers
do you, User-Agent 99?


They are people who like rules. HTML 4.01Strict is a real turn on. It's
that word 'strict' you know.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #7

P: n/a
A follow-up question/s (please excuse my ignorance of the subject):

Where/when are the following technologies used in a site:

PHP
DHTML
CSS
TABLES

CSS vs. TABLES has already had some discussion. I guess it's one of those
things where we know what the ideal goal might be but, for now, you have to
use what works. Is that a fair statement?

PHP vs. DHTML might be where I show my ignorance. As I understand it, I can
use PHP to, among other things, intelligently alter what content is shown on
a page based on a state variable or something like that. Where I got
confused was when speaking to a web guys he threw out a single statement
"You might want to think about DHTML".

Can someone point me to a discussion on where the different technologies fit
in today's web design world? In other words, when you set out to build a
non-trivial website, what technologies are chosen for the various aspects of
that site, why and how are they used?

Thanks,
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Euredjian

To send private email:
0_******@pacbell.net
where
"0_0_0_0_" = "martineu"
Jul 17 '05 #8

P: n/a
In article <sH******************@newssvr29.news.prodigy.com >,
"Martin Euredjian" <0_******@pacbell.net> wrote:

:In other words, when you set out to build a
:non-trivial website, what technologies are chosen for the various aspects of
:that site, why and how are they used?

I've found that using xhtml strict makes things easier, the rules are
easy to understand, everyone (supposedly) knows what they are and the
browser will (hopefully) render the page quicker. If you do this, you
will by default be using CSS and HTML 4.

You'll be told to avoid JavaScript, which is silly, it's part of the
browser package, and shouldn't be disabled by anyone. Not all of your
sites will be on servers with anything as nice as PHP to play with.

You'll be told to avoid frames, which I agree with, but not because
there's anything wrong with them, I just find them ugly and difficult to
manage visually.

You'll be told to avoid Flash, and that's absolutely right, it's silly
and serves no purpose if you're not an animator advertising your work.

You'll be told to design every site with blind people in mind, and this
is okay if you're designing a site for blind people; if you're designing
a site that sells auto parts, you can safely ignore the blind, because
blind people don't drive cars except in Connecticut.

Essentially, use whatever technology makes the site work and your job
easy. Try to do as much on the server side as you can. Validate validate
validate. Spell chequing is good too.
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.
Jul 17 '05 #9

P: n/a
"Martin Euredjian" <0_******@pacbell.net> schrieb:
PHP
DHTML
CSS
TABLES

Can someone point me to a discussion on where the different technologies fit
in today's web design world? In other words, when you set out to build a
non-trivial website, what technologies are chosen for the various aspects of
that site, why and how are they used?


PHP - server side scripting
DHTML - done with JavaScript for client side scripting
CSS - definition of the optical layout (kind of presentational markup)
TABLES - for tables in a (X)HTML page

PHP will work always, because I control the webservers. Tables should
work always, since they are standard since over 10 years. I use
JavaScript and CSS, but all my pages will still work if those
technologies are not present on a users browser.

Regards,
Matthias
Jul 17 '05 #10

P: n/a
On Sat, 15 Nov 2003 21:15:04 GMT, Martin Euredjian wrote:
A follow-up question/s (please excuse my ignorance of the subject):

Where/when are the following technologies used in a site:

PHP
PHP is, like the name represents, a Preprocessor. It processes your source
code (a plain text file) ON THE SERVER, before it ever gets to the viewer's
browser. This is useful, since you can spew out simple HTML that anyone's
computer can view as a result of much more complex scripting (which their
browser never knows about).
DHTML
Basically, DHTML = CSS + JavaScript
DHTML lets you work with and manuipulate your CSS and HTML elements on the
viewer's browser.
CSS
CSS allows you to present visual and styling elements which are seperate
from the content of a page. For example, in HTML, you would think like:

Profits this month were [Make this blue]One Hundred Billion Dollars![Stop
making this blue]

With the CSS way of thinking, this would be like:

(Style section)
[Make normal text black]
[Make "Monthly Profits" blue]
(etc...)

(Content Section)

Profits this month were ["Monthly Profits"]One Hundred Billion Dollars![End
"Monthly Profits"]

(This isn't actual CSS code, this is just the way of thinking.) This might
seem trivial at first, but suppose you had 120 listings on 10 pages of a
whole year's worth of stats. If you wanted to change "Monthly Profits" from
blue to green, you could just change one color in the Style file, not 120
entries in each Content file.
TABLES
Tables are for tables. They say we shouldn't use them for layout, and I
usually don't. But sometimes there's no better solution, so I have to.

CSS vs. TABLES has already had some discussion. I guess it's one of those
things where we know what the ideal goal might be but, for now, you have to
use what works. Is that a fair statement?

That's where I am now... In my mind, neither CSS (in its current
incarnation) nor Tables (ever) were meant as a layout device. I try to use
CSS as much as possible, but sometimes the CSS "hacks" you need to get
certain layouts are more convoluted than the "hackiness" of just using
tables. Just make sure you know, if you're going to want a
tightly-regulated layout, where the flakiness lies on certain browsers'
implementations of both Tables and CSS. Something done up for IE might look
like a car crash in NS4, NS6+, or a W3C browser, or vice versa.
PHP vs. DHTML might be where I show my ignorance. As I understand it, I can
use PHP to, among other things, intelligently alter what content is shown on
a page based on a state variable or something like that. Where I got
confused was when speaking to a web guys he threw out a single statement
"You might want to think about DHTML".

Well, that's a pretty right-on definiton of PHP you've got there... it
basically works after you write the text file on the server, but before
anything gets sent to the viewer. You can use scripting methods to change
what actual *code* gets sent to the viewer's browser.

DHTML is a completely different animal, not even "versus" PHP, really. It's
basically the JavaScript "interactive" end of CSS. It allows you to move,
manipulate, and work with the CSS objects you have. All DHTML, along with
JavaScript, Java, CSS, and HTML get sent to the viewer as a plain-text
file, and the viewer's web-browser does all the computing and rendering.
This brings the problems of browser versions back into play, as well as the
"What if they have JavaScript disabled" problem.

An interesting thing is, since JavaScript and DHTML are straight-text, you
can use PHP to dynamically *write* JavaScript code, although that's a
heavy-duty headache-and-a-half in a lot of cases.
Can someone point me to a discussion on where the different technologies fit
in today's web design world? In other words, when you set out to build a
non-trivial website, what technologies are chosen for the various aspects of
that site, why and how are they used?

Thanks,

-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
-- (personal replies should at least be mirrored to email)
-- (include "Hey!" in the Subject line for priority processing)
Jul 17 '05 #11

P: n/a
"FLEB" wrote:
A follow-up question/s (please excuse my ignorance of the subject):

Where/when are the following technologies used in a site:

PHP


PHP is, like the name represents, a Preprocessor. It processes your source

....

Thanks for a great rundown. Exactly what I was looking for. It sounds like
I could have a good time with PHP.

Questions:

Say I'm using PHP to handle navigation and want to (obviously) store at
least a state variable somewhere in order to keep track of what's going on.

How are these variables persisted?
Do they cross html page boundaries?

I use state machines extensively in my normal line of work (embedded,
hardware, firmware, software design). Is this technique in use to drive
websites? If so, where is the state machine code contained so that it can
control the whole site? On the surface it sounds like PHP could be used
this way.

Maybe a set of variables are declared/used in the index.htm for the site and
they retain visibility for all other pages...

Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Euredjian

To send private email:
0_******@pacbell.net
where
"0_0_0_0_" = "martineu"
Jul 17 '05 #12

P: n/a
I noticed that Message-ID:
<e%*****************@newssvr29.news.prodigy.com> from Martin Euredjian
contained the following:
Say I'm using PHP to handle navigation and want to (obviously) store at
least a state variable somewhere in order to keep track of what's going on.

How are these variables persisted?
Do they cross html page boundaries?


Yep, you need to use sessions. See my session demo:
www.ckdog.co.uk/php/color.php
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #13

P: n/a
On Mon, 17 Nov 2003 10:00:42 GMT, Martin Euredjian wrote:

(-- snip --)
Questions:

Say I'm using PHP to handle navigation and want to (obviously) store at
least a state variable somewhere in order to keep track of what's going on.

How are these variables persisted?
Do they cross html page boundaries?

I use state machines extensively in my normal line of work (embedded,
hardware, firmware, software design). Is this technique in use to drive
websites? If so, where is the state machine code contained so that it can
control the whole site? On the surface it sounds like PHP could be used
this way.

Maybe a set of variables are declared/used in the index.htm for the site and
they retain visibility for all other pages...

Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Euredjian

To send private email:
0_******@pacbell.net
where
"0_0_0_0_" = "martineu"


You'll want to look at "PHP Sessions" (English docs at
http://www.php.net/manual/en/ref.session.php ). I don't know much about it
myself, but, as far as I know, PHP sessions are basically an automated
method of using cookies and special modified links to keep an "identity" of
a session, then keep all the variable values for that session.

This can also be done the manual way, by simply making sure you pass on any
relevant information from page to page using HIDDEN form entries, the GET
portion of links (pagename.php?session=1929247 type URLs), or Cookies.

Like any stateless language (where no single script implicitly remembers
what came before it), you just have to make strategies for keeping the
important info safe and available.

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #14

P: n/a
Geoff Berrow, doing a poor impression of Alexander Hamilton, said:

Yep, you need to use sessions. See my session demo:
www.ckdog.co.uk/php/color.php


Do you have the source available?

/joe
--
A server from Gary Yngve is disappointing in the Curran Deck -OR- the
monitor from Di will go to Jordan McKible in Havoc's "say". In the
Masquerade, a monitor is disturbed.
Jul 17 '05 #15

P: n/a
I noticed that Message-ID: <bp**********@news-int2.gatech.edu> from
Disco Plumber contained the following:
Yep, you need to use sessions. See my session demo:
www.ckdog.co.uk/php/color.php


Do you have the source available?


Sure.

http://www.ckdog.co.uk/php/color.phps
http://www.ckdog.co.uk/php/page2.phps
http://www.ckdog.co.uk/php/page3.phps

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #16

P: n/a
Geoff Berrow, obviously a huge fan of Hilary Clinton, wrote:
Do you have the source available?


Sure.


Thanks, I've been curious about sessions. Thus far, I've done all
session-type stuff manually with db tables and cookies.

/joe
--
In City Cafe, the Gamecube from a crackwhore will go to Tim Faircloth.
Erika codes a replacement for the Atlanta Diner for a cable modem, and then
frequently ridicules the ~studly frat house from alexdata.
Jul 17 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.