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

Need some advice...

P: n/a
If this is off-topic, please forgive me. But I thought this might be
the perfect spot to get some advice about how to proceed with a
project.

Working on a Web site design for a nonprofit organization, and I'm
donating the work. Haven't done Web work in a while, and things have
changed since I last did anything of this magnitude. I'm looking for
a solution that will enable me to edit pages easily and in totally
WYSIWYG fashion, while providing me with the power of a language like
PHP.

I started out with standard HTML, and started adding in components
using things like CGI and SSI. SSI got shot down because it required
that clunky renaming of everything to .shtml (.shtm is not available
to me). I then moved to PHP, which I'm rather happy with, but I keep
finding I'm "painting myself into a corner" with that. An example:

<td background="/image/imagefive.gif">
<img src="../assets/user.gif" width="200" height="25">
</td>

This was a table with a name (user.gif) appearing in it. It used a
specific image for the background, but I wanted the images in the
background to be random and load a different one on each view. A PHP
call solved that nicely:

<?php include "/texture/random.php"; ?>
<img src="../assets/user.gif" width="200" height="25">
</td>

The "random.php" file generated the text for the entire <td> tag using
a random background graphic. So each time the table displayed, it was
different. Worked nicely, until I went back into my Dreamweaver to
work on it further. Dreamweaver (like most programs) couldn't
translate the PHP, and assumed the code was missing that <td> tag.
The display window showed the page in horrible shape, as it didn't
know there was a tag there. And with the display so messed up, it was
edit the code by hand or not edit at all.

I don't have the resources available to run a personal Web server, so
that idea is out (unless someone has a suggestion for Windows ME that
doesn't involve tearing my installation apart). Now I'm examining my
options. I want functionality like randomization, includes, and such.
I'm trying to avoid Javascript, at the request of the organization
(their current site is driven by Javascript, and they have huge
problems with it), but have plenty of other technologies available on
the server. PHP, CGI, SSI, and more--with some limitations.

A friend suggested Dreamweaver templates, which I'm looking into. But
I don't know that they address things like randomization and such. So
now I'm looking at what other options I have. Some things I can
comment on:

I have a CGI maintenance script that has to produce a page of
output. I hacked the script until it looked right (basically split
the page HTML in half, and dropped half in one section of the CGI and
one half in another to "surround" the CGI output). Would love to add
some PHP to the mix, but I can't figure out how to get my particular
server to parse CGI for PHP. (More on that in a moment.)

PHP is lovely to work with, and replaces Javascript quite nicely for
me. But I'm still quite the novice with it. If someone could suggest
a way to make the above example work without destroying my previews in
Dreamweaver, I'd be happy. But if I'm having to constantly keep the
WYSIWYG display in mind when building pages, I'm going to have
trouble.

Dreamweaver works quite well with SSI, but I don't want to resort to
that horrible .shtml naming. I know you can parse for PHP and such
with a custom .htaccess file, but I'm told there are a lot of
potential problems with that. Can anyone comment?

CGI is a huge security issue for my host, apparently, and they
insist on checking out any CGI scripts before allowing them to be
used. I can get some minor stuff put into use, but the majority of it
is disallowed. As such, I'd rather not be dependent on it.

Other than turning off the underline on hyperlinks and such easy
tricks, I know very little about CSS. Is there more to CSS than just
applying uniform styles to things?

What options exist for passing environmental and other variables to
HTML itself? The $_SERVER['DOCUMENT_ROOT'] function in PHP is a
lifesaver! I'd like to be able to pass things to HTML without
freaking out my editor. (Being able to do something like <a
href=$url> without a script call would be nice, but I'm not sure it's
possible.) On a related note, does PHP "break" a tag if inserted in
the middle of it? Such as in <a href=<?php include($_SERVER
["DOCUMENT_ROOT"] . '/pages/display.php'); ?>> -- will HTML treat that
as a complete tag structure and ignore the fact that the middle is
gibberish? (And yes, I'm sure the syntax of that example is horribly
wrong...)

Any comments or suggestions on this complex problem are most
appreciated. I'd particularly like to hear some real-world pros and
cons of the different technologies available to me (PHP, CGI, SSI, and
whatever else you think is relevant). I'd much prefer to keep my
working environment in Dreamweaver, which came to favor after trying
several editors (FrontPage, NetObjects Fusion, and several more), but
would be open to trying something that maintains the WYSIWYG
environment and generates clean code.

I know this is not a specific question, but it's kinda hard to nail it
down to one specific thing. Mainly, I need some good advice so I can
make an educated decision about which way to go. I'm not the least
bit afraid to RTFM, so any Internet sites with accurate and complete
information are appreciated.

Thanks for any insight!

Marquisha
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 24 Sep 2004 17:27:17 -0700, Marquisha <ms********@netscape.net> wrote:
If this is off-topic, please forgive me. But I thought this might be
the perfect spot to get some advice about how to proceed with a
project.

Working on a Web site design for a nonprofit organization, and I'm
donating the work. Haven't done Web work in a while, and things have
changed since I last did anything of this magnitude. I'm looking for
a solution that will enable me to edit pages easily and in totally
WYSIWYG fashion, while providing me with the power of a language like
PHP.

I started out with standard HTML, and started adding in components
using things like CGI and SSI. SSI got shot down because it required
that clunky renaming of everything to .shtml (.shtm is not available
to me).
Actually, a server can be configured to parse everything for SSI, you have
to tell it to. Stil, PHP is more powerful.
I then moved to PHP, which I'm rather happy with, but I keep
finding I'm "painting myself into a corner" with that. An example:

<td background="/image/imagefive.gif">
<img src="../assets/user.gif" width="200" height="25">
</td>

This was a table with a name (user.gif) appearing in it. It used a
specific image for the background, but I wanted the images in the
background to be random and load a different one on each view. A PHP
call solved that nicely:

<?php include "/texture/random.php"; ?>
<img src="../assets/user.gif" width="200" height="25">
</td>

The "random.php" file generated the text for the entire <td> tag using
a random background graphic. So each time the table displayed, it was
different. Worked nicely, until I went back into my Dreamweaver to
work on it further. Dreamweaver (like most programs) couldn't
translate the PHP, and assumed the code was missing that <td> tag.
The display window showed the page in horrible shape, as it didn't
know there was a tag there. And with the display so messed up, it was
edit the code by hand or not edit at all.
You'd have to configure your computer with PHP and to act as a server for
even your browser to work with the PHP in a local file.

I'm a little less informed on PHP than I would need to be to comment
further.
• Other than turning off the underline on hyperlinks and such easy
tricks, I know very little about CSS. Is there more to CSS than just
applying uniform styles to things?


Oh my yes. The entire site layout can (and, in my opinion, should) be done
with CSS. Use HTML to mark up the content semantically, use CSS to suggest
the rendering to the UA.

Consult the w3schools.com CSS tutorial for info on what it can do.
Jul 23 '05 #2

P: n/a
ms********@netscape.net (Marquisha) wrote in
news:51**************************@posting.google.c om:
Working on a Web site design for a nonprofit organization, and I'm
donating the work. Haven't done Web work in a while, and things have
changed since I last did anything of this magnitude. I'm looking for
a solution that will enable me to edit pages easily and in totally
WYSIWYG fashion, while providing me with the power of a language like
PHP.
There's your first problem - forget about WYSIWYG on the WWW!
Use HTML to markup your documents. Use CSS for presentation.
Use various browsers, with various viewport sizes, and various
fonts available, with various font sizes, to get an idea of
what the webpage will look like to all your various site visitors.
<?php include "/texture/random.php"; ?>
<img src="../assets/user.gif" width="200" height="25">
</td>

The "random.php" file generated the text for the entire <td> tag using
a random background graphic. So each time the table displayed, it was
different. Worked nicely, until I went back into my Dreamweaver to
work on it further. Dreamweaver (like most programs) couldn't
translate the PHP, and assumed the code was missing that <td> tag.
PHP stands for "PHP: Hypertext Preprocessor".
HTML stands for "HyperText Markup Language".

You can create a file that includes PHP, and HTML, such as
your example above. PHP must process that file before it
will make sense as an HTML document(i.e. pre-process it before
it is presented to the browser).
I don't have the resources available to run a personal Web server, so
that idea is out (unless someone has a suggestion for Windows ME that
doesn't involve tearing my installation apart).
Do a Google Groups search for a thread from 2002 in the
macromedia.dreamweaver newsgroup titled " Windows ME with Server".

Or, just do the editing locally, then upload the file to the
server and display it in your browser.
PHP is lovely to work with, and replaces Javascript quite nicely for
me. But I'm still quite the novice with it. If someone could suggest
a way to make the above example work without destroying my previews in
Dreamweaver, I'd be happy. But if I'm having to constantly keep the
WYSIWYG display in mind when building pages, I'm going to have
trouble.
Yes, you are, and it's got more to do with your notion of needing
"WYSIWYG", than to do with PHP. Use a browser to do your "previews".
As a developer, you should seriously consider FireFox, along with
some of the key extensions such as the DOM Inspector, Web Developer
toolbar, and LiveHTTPHeaders.
What options exist for passing environmental and other variables to
HTML itself? The $_SERVER['DOCUMENT_ROOT'] function in PHP is a
lifesaver! I'd like to be able to pass things to HTML without
freaking out my editor. (Being able to do something like <a
href=$url> without a script call would be nice, but I'm not sure it's
possible.)
HTML is a markup language, not a programming language, so no options
exist for "passing variables" to HTML.
On a related note, does PHP "break" a tag if inserted in
the middle of it? Such as in <a href=<?php include($_SERVER
["DOCUMENT_ROOT"] . '/pages/display.php'); ?>> -- will HTML treat that
as a complete tag structure and ignore the fact that the middle is
gibberish? (And yes, I'm sure the syntax of that example is horribly
wrong...)


Your thinking is backwards. HTML doesn't "treat" anything - it describes
the markup of a document. A file, containing the above example, when
processed by PHP, will replace "<?php include($_SERVER["DOCUMENT_ROOT"] .
'/pages/display.php'); ?>" with "something". That "something" would,
hopefully, in this example, be a proper anchor tag href string
(e.g. "/somedocument.html"), but could also be a PHP error message,
if PHP encounters, and generates, errors.
Assuming PHP generates what you wanted, then the generated HTML output
will consist of something like:
<a href="/somedocument.html">

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Jul 23 '05 #3

P: n/a
Neal wrote:
Consult the w3schools.com CSS tutorial for info on what it can do.


Now THAT'S the kind of stuff I was looking for. I've already passed
the URL on to several friends, who are delighted to have that much
info in one convenient place. Now let's just hope they don't go
commercial and start charging for it. ;-) Thanks so much for that
URL, Neal!

I won't even comment on that other post. Instead let me tell you the
two things that fixed my situation.

First thing I did was toy with Microsoft Personal Web Server, courtesy
my last computer's Windows 98SE CD, and it was a nightmare. The
instructions for installing it under Windows ME were not working for
me at all--kept crashing, and I couldn't get PHP to run under it to
save my life. Gave up, finally, and asked a friend what alternatives
were available. He chirped, "Apache!"

So I grabbed Apache and put it in. Fired right up, and I then put PHP
in courtesy a handy page at
http://www.thesitewizard.com/archive/php4install.shtml. Up it came,
and I had my own local testing server. Only drawback to it is that it
takes several seconds to load the data for a LiveData view, and I'd
figure it would load mighty fast being local files moving to a local
client. Wonder why?

Then tinkered with the PHP code, and solved my problem another way.
Instead of having PHP call the entire HTML tag, I had it just insert
the path to the background graphic. The tag itself is still in the
realm of HTML, and Dreamweaver now "sees" it and displays my page
properly so I can edit on it without hitting the code by hand.

Thanks again for that site. The more I learn about PHP, the more I
like. Might as well add it to my repertoire of languages, and got
plenty of reference on that site to learn by. Need to brush up on my
CSS as well, but we won't talk about that... ;-)

Marquisha
Jul 23 '05 #4

P: n/a
ms********@netscape.net (Marquisha) wrote in
news:51*************************@posting.google.co m:
I won't even comment on that other post.


That "other post" was my September 25th reply in this thread.

There is no need for you to comment on it, but the tone
of your statement indicates you have something negative
to say about my posting. If there are parts of it you
don't understand, or take issue with, then it's appropriate
for you to reply to it, but if you don't want to bother,
that's your perogative.

--
Dave Patton
Canadian Coordinator, Degree Confluence Project
http://www.confluence.org/
My website: http://members.shaw.ca/davepatton/
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.