syntax question [message #174322] |
Sat, 04 June 2011 18:16  |
Co
Messages: 75 Registered: May 2011
Karma: 0
|
Member |
|
|
Hi,
I have this code inside a php page to display a table.
$outputList .= '
<table width="100%" border="0"><tr><td width="12%" valign="top"
rowspan="4"><div style=" height:80px; overflow:hidden;"><a
href="profile.php?id=' . $member_id . '" target="_self">' .
$user_pic . '</a></td></tr>
<tr ><td width="40%" ><div class="name" align="left">' . $firstname .
' ' . $lastname . ' <font color="#000000" style="font-size: 9pt;
font-weight: normal"> ' . $date_day . ' ' . $date_month . ' ' .
$date_year . '</div>
</td></tr><tr><td width="100%" class="title"><a
href="Printbb_message.php?id=' . $id . '"> ' . $title . '</a></td></
tr><tr><td width="100%" valign="left">' . $subject . ' </td></tr></
table>' if ($i < $itemsPerPage){ echo '<hr>'; }
';
this outputlist is displayed in the page and only if the record is not
the last on the page I want a line drawn underneath.
if ($i < $itemsPerPage){ echo '<hr>'; }
How do I fit this code in. I can't get it right.
Regards
Marco
|
|
|
|
|
|
|
|
Re: syntax question [message #174329 is a reply to message #174327] |
Sun, 05 June 2011 00:32   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 6/4/2011 5:24 PM, Co wrote:
> On 4 jun, 22:54, The Natural Philosopher<t...@invalid.invalid> wrote:
>> Co wrote:
>>> On 4 jun, 21:00, Derek Turner<frde...@cesmail.net> wrote:
>>>> On Sat, 04 Jun 2011 11:16:32 -0700, Co wrote:
>>>> > How do I fit this code in. I can't get it right.
>>>> Sorry, you may not want to hear this but IMO all the formatting should be
>>>> in CSS - either inline or external.
>>
>>> What is the advantage of having it all in CSS?
>>
>>> Marco
>>
>> Bit less bandwidth. Bit tidier. Bit easier to follow the code..
>
> What would it look like, I am pretty green on CSS this way.
>
> Marco
Try a CSS newsgroup.... This one's for PHP.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
|
|
|
|
Re: syntax question [message #174343 is a reply to message #174340] |
Mon, 06 June 2011 10:20   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 6/6/2011 12:30 AM, jeff wrote:
> On 6/5/2011 5:26 PM, Denis McMahon wrote:
>> On Sat, 04 Jun 2011 11:16:32 -0700, Co wrote:
> <snip>
>> Oh gods. Lay the code out so you can see it!
>>
>> If you use the heredoc format, you can lay your code out so that you have
>> a better chance of spotting missing tags etc.
>
> I've been looking at a lot of newbie and not so newbie php lately and
> absolutely no one is using heredocs.
>
> It's concatenation hell to read and I imagine just as hard to write.
> Mistakes abound, as you might expect.
>
> So for those two lines of heredoc prose, I thank you.
>
> Jeff
>
I don't know who's code you've been looking at, but I've seen a lot of
heredoc code used. It can be quite useful in a lot of situations. It's
easy to both read and write.
However, your comments about "concatenation hell" makes me wonder if you
understand what heredoc actually is. There is no concatenation in heredoc.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|
Re: syntax question [message #174344 is a reply to message #174343] |
Mon, 06 June 2011 11:19  |
jeff
 Messages: 8 Registered: May 2005 Location: Toronto
Karma: 0
|
Junior Member |
|
|
On 6/6/2011 6:20 AM, Jerry Stuckle wrote:
> On 6/6/2011 12:30 AM, jeff wrote:
>> On 6/5/2011 5:26 PM, Denis McMahon wrote:
>>> On Sat, 04 Jun 2011 11:16:32 -0700, Co wrote:
>> <snip>
>>> Oh gods. Lay the code out so you can see it!
>>>
>>> If you use the heredoc format, you can lay your code out so that you
>>> have
>>> a better chance of spotting missing tags etc.
>>
>> I've been looking at a lot of newbie and not so newbie php lately and
>> absolutely no one is using heredocs.
>>
>> It's concatenation hell to read and I imagine just as hard to write.
>> Mistakes abound, as you might expect.
>>
>> So for those two lines of heredoc prose, I thank you.
>>
>> Jeff
>>
>
> I don't know who's code you've been looking at, but I've seen a lot of
> heredoc code used.
I hung out in web developer forum for about a month. Don't remember a
single example that wasn't mine. (for that matter I'm not sure I saw a
function, let alone an object) I think that when newbies learn, this is
never something they learn. Some never get around to it.
It can be quite useful in a lot of situations. It's
> easy to both read and write.
Of course it is. Jerry we are on the same page, which has always been a
bit hard for you to grasp.
>
> However, your comments about "concatenation hell" makes me wonder if you
> understand what heredoc actually is. There is no concatenation in heredoc.
Which is a great reason to use it.
The beauty and curse of PHP, like the old ASP is that you can write
completely unmaintainable procedural code and it all works. Until you
need to change it...
>
|
|
|