On Dom 02 Jun 2002 21:45, David Freeman wrote:
I've noticed that many people on the list code in 'pure' php, i.e.
?
print input type='text' name='fname' size='50';
// etc
?
Personally, it depends on what I'm doing. I find that excessive use of
? And ? in my code gets
I've noticed that many people on the list code in 'pure' php, i.e.
?
print input type='text' name='fname' size='50';
// etc
?
Since most of my code is a mixture (the early stuff is 'mixed' html + php),
I've been wondering why code in 'pure' php? Is there some compelling reason
(that I'm
No *real* reason - just two not-so-important ones:
1. Clarity
Please compare these two:
-- MIXED
td bgcolor=?php echo $td_col; ? class=?php echo $prefclass; ?
?php $fldcontent=$myrow[0]?$myrow[0]:no data; ?
input type=text name=fname size=50 value=?php echo $fldcontent;
?
/td
-- PURE
Thanks Bogdan,
That's what I thought, but I was beginning to feel 'guilty' the more I
understood php. It seems to me, from my limited experience, that there's much
mor chance for error using 'pure' php (as in forgetting ' or or closing
with ; -- but . . .
Actually I've found that the
On Sunday 02 June 2002 08:13 pm, you wrote:
On Sun, Jun 02, 2002 at 07:55:09PM -0400, Andre Dubuc wrote:
I've noticed that many people on the list code in 'pure' php, i.e.
?
print input type='text' name='fname' size='50';
// etc
?
Since most of my code is a mixture (the early
I'm not sure what you mean... Is it checking that you fill in the
correct values via PHP or that the submission works - or something else?
Bogdan
Andre Dubuc wrote:
Thanks Bogdan,
That's what I thought, but I was beginning to feel 'guilty' the more I
understood php. It seems to me, from my
However...
From the point of view of someone who has worked in a company where diesign
is separated from development, it is much better to have separate files with
HTML templates with special markers (in the library I use, it is HTML
comments !--element_to_replace--) so that the two processes
That's what I meant. I was referring to verification/validation scripts for
user inputs. I've made a separate page that runs these routines. I have a
feeling I should have incorporated them on the user input page . . . but
does it really amtter if they're on another page?
Andre
On Sunday 02
I would ask the question How much HTML before you break out of PHP and into
HTML. My answer is any. Surely you're making the engine work just to echo
stuff out? But are you asking for more by making it jump in and out between
all those tags?!
Short tags ...
td bgcolor=?=$td_col?
Thanks Michael,
Point well-made. I suppose doing it the mixed way might have repercussions
later on if/when the site grows. Perhaps while the code is still fresh in my
mid, it might be worth the effort to separate it.
However, for a good part of the site, I've used CSS for appearance details,
I've noticed that many people on the list code in 'pure' php, i.e.
?
print input type='text' name='fname' size='50';
// etc
?
Personally, it depends on what I'm doing. I find that excessive use of
? And ? in my code gets distracting so if I need a lot of php code I
will usually
No, it doesn't - just go with whatever's simpler for you... and with
what matches your application better - I don't think this does matter at
all.
Bogdan
Andre Dubuc wrote:
That's what I meant. I was referring to verification/validation scripts for
user inputs. I've made a separate page
I fell for this some time ago - but the trick is that
1. You don't do for ($i=0; $i999; $i++) { echo Line $ibr\n;
} in real life - you do stuff, call object methods, run queries,
whatever, and in between those you have both html and php - and the
remote machine waits for you to do all
Point well-made. I suppose doing it the mixed way might have repercussions
later on if/when the site grows. Perhaps while the code is still fresh in
my
mid, it might be worth the effort to separate it.
However, for a good part of the site, I've used CSS for appearance
details,
and
This whole discussion made me really curious - so you might want to
check the attachments (access mixtest.php) for a very surprising result
(please note mixed.php and pure.php are exactly the same size so this
doesn't affect the test).
Bogdan
Marcelo Leitner wrote:
On Mon, Jun 03, 2002 at
I was getting a typical 2.5% more for pure PHP with the original order -
switching them increases the difference to about 6.5% more for pure PHP.
Make sure you run it several times before drawing any conclusions, BTW.
Strange...
Bogdan
Marcelo Leitner wrote:
On Mon, Jun 03, 2002 at
16 matches
Mail list logo