Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #11288 > unrolled thread

simple url problem

Started byrichard <noreply@example.com>
First post2013-10-04 23:20 -0400
Last post2013-10-05 22:51 +0100
Articles 7 — 5 participants

Back to article view | Back to comp.lang.php


Contents

  simple url problem richard <noreply@example.com> - 2013-10-04 23:20 -0400
    Re: simple url problem richard <noreply@example.com> - 2013-10-04 23:28 -0400
      Re: simple url problem The Natural Philosopher <tnp@invalid.invalid> - 2013-10-05 08:55 +0100
        Re: simple url problem Norman Peelman <npeelman@cfl.rr.com> - 2013-10-05 07:43 -0400
    Re: simple url problem Norman Peelman <npeelman@cfl.rr.com> - 2013-10-05 01:09 -0400
      Re: simple url problem Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-05 18:29 +0000
        Re: simple url problem Tim Streater <timstreater@greenbee.net> - 2013-10-05 22:51 +0100

#11288 — simple url problem

Fromrichard <noreply@example.com>
Date2013-10-04 23:20 -0400
Subjectsimple url problem
Message-ID<1u7hl6faeyoet$.14yt7rp1zju49$.dlg@40tude.net>

I am trying to mimmick the tenplate shown.
But I get a parse error where I have $myurl.

I believe it is becaause of the dot.
How do I work around this?


    <!-- single playlist entry as an "template" -->
    <a class="item" href="http://mroldies.net/videos/1960/summerplace.flv">
        A Summer Place - Movie Theme <span>Percy Fiath Orchestra</span>
        <em>1960 # 1</em>
    </a>

<?php

$aid=1;

while ($aid<21)
{
echo "< a class='item'"

$myurl='href="http://mroldies.net/videos/"';
echo $myurl;

echo "\n";
echo $playme[$aid][0];
echo "<span>";
echo $playme[$aid][1];
echo "</span>\n";
echo "<em>>$playme[$aid][2]</em>\n";

echo "</a";

$aid++;
}


?>

[toc] | [next] | [standalone]


#11289

Fromrichard <noreply@example.com>
Date2013-10-04 23:28 -0400
Message-ID<5q26ik8ktwga$.xposxxq14t3x.dlg@40tude.net>
In reply to#11288
Stupid me again.
forgot the ; at the end of the line above the error.



On Fri, 4 Oct 2013 23:20:29 -0400, richard wrote:

> I am trying to mimmick the tenplate shown.
> But I get a parse error where I have $myurl.
> 
> I believe it is becaause of the dot.
> How do I work around this?
> 
> 
>     <!-- single playlist entry as an "template" -->
>     <a class="item" href="http://mroldies.net/videos/1960/summerplace.flv">
>         A Summer Place - Movie Theme <span>Percy Fiath Orchestra</span>
>         <em>1960 # 1</em>
>     </a>
> 
> <?php
> 
> $aid=1;
> 
> while ($aid<21)
> {
> echo "< a class='item'"
> 
> $myurl='href="http://mroldies.net/videos/"';
> echo $myurl;
> 
> echo "\n";
> echo $playme[$aid][0];
> echo "<span>";
> echo $playme[$aid][1];
> echo "</span>\n";
> echo "<em>>$playme[$aid][2]</em>\n";
> 
> echo "</a";
> 
> $aid++;
> }
> 
> 
> ?>

[toc] | [prev] | [next] | [standalone]


#11293

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-10-05 08:55 +0100
Message-ID<l2ogma$4ur$2@news.albasani.net>
In reply to#11289
On 05/10/13 04:28, richard wrote:
>
> Stupid me again.
> forgot the ; at the end of the line above the error.
>
>> echo "</a";
>>^^^^^^^^^^^^^
and the closing >

>> $aid++;
>> }
>>
>>
>> ?>


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


#11294

FromNorman Peelman <npeelman@cfl.rr.com>
Date2013-10-05 07:43 -0400
Message-ID<l2ou1q$11b$1@dont-email.me>
In reply to#11293
On 10/05/2013 03:55 AM, The Natural Philosopher wrote:
> On 05/10/13 04:28, richard wrote:
>>
>> Stupid me again.
>> forgot the ; at the end of the line above the error.
>>
>>> echo "</a";
>>> ^^^^^^^^^^^^^
> and the closing >
>
>>> $aid++;
>>> }
>>>
>>>
>>> ?>
>
>

   Yes, I saw that too, fixed it in my follow up.

-- 
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-

[toc] | [prev] | [next] | [standalone]


#11291

FromNorman Peelman <npeelman@cfl.rr.com>
Date2013-10-05 01:09 -0400
Message-ID<l2o6ui$pgm$1@dont-email.me>
In reply to#11288
On 10/04/2013 11:20 PM, richard wrote:
>
>
> I am trying to mimmick the tenplate shown.
> But I get a parse error where I have $myurl.
>
> I believe it is becaause of the dot.
> How do I work around this?
>
>
>      <!-- single playlist entry as an "template" -->
>      <a class="item" href="http://mroldies.net/videos/1960/summerplace.flv">
>          A Summer Place - Movie Theme <span>Percy Fiath Orchestra</span>
>          <em>1960 # 1</em>
>      </a>
>
> <?php
>
> $aid=1;
>
> while ($aid<21)
> {
> echo "< a class='item'"
>
> $myurl='href="http://mroldies.net/videos/"';
> echo $myurl;
>
> echo "\n";
> echo $playme[$aid][0];
> echo "<span>";
> echo $playme[$aid][1];
> echo "</span>\n";
> echo "<em>$playme[$aid][2]</em>\n";
>
> echo "</a";
>
> $aid++;
> }
>
>
> ?>
>

$aid = 1;
while ($aid < 21)
{
   $myurl = "<a class='item' 
href='http://mroldies.net/videos/{$playme[$aid][0]}'\n<span>{$playme[$aid][1]}</span>\n<em>{$playme[$aid][2]}</em>\n</a>\n";

   echo $myurl;
   $aid++;
}

-or-

$aid = 1;
while ($aid < 21)
{
  $myurl = "<a class='item' href='http://mroldies.net/video/";
$myurl .= "{$playme[$aid][0]}'\n ";
$myurl .= "<span>{$playme[$aid][1]}</span>\n";
$myurl .= "<em>{$playme[$aid][2]}</em>\n</a>\n";

echo $myurl;
$aid++;
}

-or HEREDOC syntax-

$aid = 1;
while ($aid < 21)
{
   echo <<<HTML

<a class="item" href="http://mroldies.net/video/{$playme[$aid][0]}"
  <span>{$playme[$aid][1]}</span>
  <em>{$playme[$aid][2]}</em>
</a>

HTML;
$aid++;
}

   Do what you like. My preference is to have my HTML (in code) look 
pretty close to what I expect to see in the browser (view source).

-- 
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-

[toc] | [prev] | [next] | [standalone]


#11295

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-10-05 18:29 +0000
Message-ID<l2plpp$2o4$1@dont-email.me>
In reply to#11291
On Sat, 05 Oct 2013 01:09:37 -0400, Norman Peelman wrote:

> On 10/04/2013 11:20 PM, richard wrote:

>> [woe is me, for I can't make php produce correct html]

> -or HEREDOC syntax-
>    Do what you like. My preference is to have my HTML (in code) look
> pretty close to what I expect to see in the browser (view source).

Mine too, it makes it a lot easier to debug broken html, and I think I 
probably don't generate as much broken stuff in the first place with 
heredoc, simply because there's less escaping etc needed.

I see Richard still hasn't learned to run his html through the validator, 
see where it fails to validate and track that back to his php code before 
bringing his broken html issues here though. And these are html issues, 
not php ones - his php is outputting the exact strings he's telling it 
to, he's just put duff content in those strings.

By the way, just as a fyi everyone, Richard has a clone called Nick in 
the python group.

(Am I allowed to say python here?)

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#11298

FromTim Streater <timstreater@greenbee.net>
Date2013-10-05 22:51 +0100
Message-ID<timstreater-7D3BD7.22515905102013@news.individual.net>
In reply to#11295
In article <l2plpp$2o4$1@dont-email.me>,
 Denis McMahon <denismfmcmahon@gmail.com> wrote:

> On Sat, 05 Oct 2013 01:09:37 -0400, Norman Peelman wrote:
> 
> > On 10/04/2013 11:20 PM, richard wrote:
> 
> >> [woe is me, for I can't make php produce correct html]
> 
> > -or HEREDOC syntax-
> >    Do what you like. My preference is to have my HTML (in code) look
> > pretty close to what I expect to see in the browser (view source).
> 
> Mine too, it makes it a lot easier to debug broken html, and I think I 
> probably don't generate as much broken stuff in the first place with 
> heredoc, simply because there's less escaping etc needed.
> 
> I see Richard still hasn't learned to run his html through the validator, 
> see where it fails to validate and track that back to his php code before 
> bringing his broken html issues here though. And these are html issues, 
> not php ones - his php is outputting the exact strings he's telling it 
> to, he's just put duff content in those strings.
> 
> By the way, just as a fyi everyone, Richard has a clone called Nick in 
> the python group.
> 
> (Am I allowed to say python here?)

It would be nice if richard learnt to fix his trivial typos before 
coming here.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web