Re: Really simple PHP (sorta) question



The Natural Philosopher wrote:
Jerry Stuckle wrote:
Mike Silva wrote:
On Feb 17, 2:31 am, The Natural Philosopher <a...@xxx> wrote:
Mike Silva wrote:
On Feb 16, 12:54 pm, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:
Mike Silva wrote:
I'm pretty sure this is not the right group to ask this question, but
I'm even more sure that I don't know what the right group is, so I
hope you'll bear with me.
I'd like to know what a suggested setup is for developing web software
on Windows. I'm a web novice but longtime programmer. So far I've
installed Apache, PHP and MySQL and that all seems to work. What's
missing is the application to write the web code. I'm assuming most
of you don't do this in a text editor, but I suppose I could be wrong
about that. I've seen a few references here to Dreamweaver, for
example. Is Frontpage still being used?
Anyway, if you could just suggest a few top candidates for that
missing bit, I'd appreciate it. Then maybe I can come back and ask
real PHP questions. Or, if you think I really should be asking on a
different group, can you direct me there? Thanks.
Mike
Actually, I do use a text editor. I find most of the application
generators produce pretty lousy html and code; I used to spend more time
cleaning things up and making them work than it would have taken me to
write it in the first place.
A syntactically-aware editor such as Crimson helps.
OK, I'm not really surprised to hear that my uninformed assumption is,
well, uninformed.
So, are many people actually writing "serious" websites (e.g. e-
commerce) with text editors? That would be a fascinating and
unexpected piece of news to ignorant me.
Well I take the site seriously...but yes.

Ive written thousands of lines of very serious software in Vi...as well.

Now that is a 'text editor'

A lot depends on whether your site is 'flashy HTML, with a few calls to
a simple database' in which case Dreamweaver, once you can drive it
well, works.

Or if your site is a 'massive calls to a database, with a few form
boxes an a lot of lists'

Which mine is.

Even if its both, you would be likeley to e.g. code the compute
intensive bits with a text editor, an then incorporate them in a
separate file and do the arty bits in dreamweaver.

This is beginning to make more sense now. I can certainly see the
benefits to editing code in a text editor, especially a language-aware
editor. And it seems most productive for somebody like me to get the
"arty bits" going with WYSIWYG. And I need to get productive here
ASAP.

So would I be drawing valid conclusions to conclude that I should be
editing "traditional code" (data manipulation stuff) with traditional
code editing tools, and HTML look-and-feel stuff with WYSIWYG tools?

Mike

You can do HTML with look-and-feel stuff, but be prepared to go back and clean it up. I have yet to see one which does a good job, especially when the CSS gets a bit complicated.


This is essentially down to who is the master.

My wife writes dreamweaver stuff, and it needs huge cleanups. Because she doesnt really understand HTML, and just frigs till things look good. Which they do.

Then you find its full of empty blocks, and there is a style statement in every one.


So you try and build a style ***..

I go the other way.

I have a library of not especial;y good coded nits like this

function check_box($x,$y,$label,$name,$value,$width)
{
$x1=$width-20;
?>
<div class=" menu" style="position: absolute; left: <?echo $x;?>px; top:<?echo ($y);?>px; width:<?echo $x1;?>px; height: 19px; text-align:right; font-weight: bold;">
<?echo $label?>:</div>
<div style="position: absolute; left: <?echo ($x+$x1+14);?>px;top:<?echo ($y+4);?>px; width:<?echo ($width-$x1);?>px; height:19px;">
<input type="checkbox" name="<?echo $name;?>" value="yes" <? echo ($value? checked:"") ?>></div> <?
}

which draws a tickable box with a standard label at preset coordinates in a specified style, sets up a name for it and a value..

Instead of using a mouse to drag my elements around, I simply vary x and y to get it lined up and do a save/reload on the screen in question to check it

Its no slower ;-)

I you are building forms I really recommend this sort of approach. You could probably do it more object oriented and elegant, but it works for me.



I have a simple class I wrote where I just initialize it with field names. Optionally field types, sizes, labels, and whatever other properties a form element may have.

That creates an editible form in a two column table with the labels in the first column and the form elements in the second. Usually I just style everything as a descendant of that table. Sometimes I'll need to rearrange the html, so I'll just copy the html out of the generated page and do that.

I've expanded this enough so that I can account for image and file uploads and generate thumbs and change paths as needed, just by changing the object initialization.

Works for me and my clients. I can set up a complex form and have all the database backend in a matter of minutes. It's my third or fourth generation form maker (the others are in perl) and I expand it as needed, for example I can display all data in a table with suitable headers and make any or all fields ajax editable.

Everyone has their own needs, but making the tools you need will save enormous amounts of time in creation and debugging, down the road.

Form making is one of those tasks that programmers have to do over and over again.

Jeff


.