|
Posted by Paul Furman on 07/29/07 01:26
Adrienne Boswell wrote:
> Gazing into my crystal ball I observed Paul Furman <paul-@-edgehill.net>
> writing in news:ykMqi.29886$2v1.842@newssvr14.news.prodigy.net:
>
>>I know it's wrong but it works: putting the <title> in the body of the
>>document inside another <head> because I'm generating this with php &
>>kind of boxed myself into not having access to the text I want till I
>>get well into the body, for example:
>>http://edgehill.net/gallery/photo-update/6-24-07/pg1pc1
>
> Better to put all your logic at the beginning of your script.
Yes, that's my problem. I'm not sure it's easier to debug though, that
approach puts the html miles away from the relevant code so it's far
from easy (to me anyways). But yeah I did it wrong. I did do it right in
some portions of the code.
> Close connections as soon as possible.
No databse in this site believe it or not, it's all just nested folders
with content & little .txt files for annotations & shortcuts! I believe
it is rather hard on the poor server.
> It's also easier for you, as a
> developer, to put that stuff at the top, easier to find and debug. I
> write mostly ASP, but the same is true for any language, eg:
>
> <% option explicit%>
> <!--#include file="connectionstring_inc.asp"-->
> <% 'declare variables
> 'open recordsets, get info and put it into arrays
> 'close recordsets
> %>
> <!--#include file="linkrel_inc.asp"-->
> <% 'above file includes the Doctype, html and head elements, stylesheet,
> favicon, title, and meta information
> %>
> </head>
> <body>
> ...
> <!--#include footer_inc.asp"-->
> <% 'above closes db connection, end body and html %>
>
>
--
Paul Furman Photography
http://edgehill.net
Bay Natives Nursery
http://www.baynatives.com
[Back to original message]
|