This is a discussion on Strange effect within the PHP Language forums, part of the PHP Programming Forums category; www.outerlimitsfan.co.uk/render.jpg The browser names are pulled from a array and most of the time get ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
www.outerlimitsfan.co.uk/render.jpg
The browser names are pulled from a array and most of the time get displayed with no problems . But sometimes only the first letter of the browser name gets displayed as shown in the above image . ? . $broo[1]="Internet Explorer"; $broo[2]="Firefox"; $broo[3]="Opera"; $broo[4]="Safari"; $broo[5]="Macintosh"; $broo[6]="Unknown"; ?> <table border="0" cellspacing="4" cellpadding="0" align="center"> <?php $tvx=1; while ($tvx<7) { $zod=$broo[$tvx]; $uzi="users"; if ($curd[$tvx]==0) {$uzi="";} if ($curd[$tvx]==1) {$uzi="user";} print "<tr>"; print "<td class=bba> </td>"; print "<td class=vva>$zod</td>"; print "<td class=bba> </td>"; print "<td>$hippy1</td>"; print "<td align=right class=ppa>$curd[$tvx]</td>"; print "<td class=ppa>$uzi</td>"; print "<td class=bba> </td>"; print "<td>$hippy2</td>"; print "<td align=right class=kka>$jamm[$tvx]</td>"; print "<td class=kka>most ever online</td>"; print "<td class=bba> </td>"; print "</tr>"; $tvx=$tvx+1; } ?> </table> |
|
|||
|
On 15.08.2007 12:24 Krustov wrote:
> www.outerlimitsfan.co.uk/render.jpg > > The browser names are pulled from a array and most of the time get > displayed with no problems . > > But sometimes only the first letter of the browser name gets displayed > as shown in the above image . > > ? . > > > > > > $broo[1]="Internet Explorer"; > $broo[2]="Firefox"; > $broo[3]="Opera"; > $broo[4]="Safari"; > $broo[5]="Macintosh"; > $broo[6]="Unknown"; > > ?> > > <table border="0" cellspacing="4" cellpadding="0" align="center"> > <?php > $tvx=1; > while ($tvx<7) > { > $zod=$broo[$tvx]; > $uzi="users"; > if ($curd[$tvx]==0) {$uzi="";} > if ($curd[$tvx]==1) {$uzi="user";} > print "<tr>"; > print "<td class=bba> </td>"; > print "<td class=vva>$zod</td>"; > print "<td class=bba> </td>"; > print "<td>$hippy1</td>"; > print "<td align=right class=ppa>$curd[$tvx]</td>"; > print "<td class=ppa>$uzi</td>"; > print "<td class=bba> </td>"; > print "<td>$hippy2</td>"; > print "<td align=right class=kka>$jamm[$tvx]</td>"; > print "<td class=kka>most ever online</td>"; > print "<td class=bba> </td>"; > print "</tr>"; > $tvx=$tvx+1; > } > ?> > </table> I like your variable naming. ;) Try var_dump instead of echo add look what it says. -- gosha bine makrell ~ http://www.tagarga.com/blok/makrell php done right ;) http://code.google.com/p/pihipi |
|
|||
|
On Wed, 15 Aug 2007 12:24:45 +0200, Krustov <me@privacy.net> wrote:
> www.outerlimitsfan.co.uk/render.jpg > > The browser names are pulled from a array and most of the time get > displayed with no problems . > > But sometimes only the first letter of the browser name gets displayed > as shown in the above image . The code doesn't seem the problem. The only way I can think of this can happen is if you accidentally select the first 'array-item' of a string ($zod[0]), but that doesn't happen anywhere in the code. I've reloaded your frontpage a couple of dozens of times, can't seem to reproduce the error. If it's displayed incorrectly, is the HTML source also wrong, or is it just the displaying of it? It might be more of an HTML/CSS/UA issue. -- Rik Wasmus |
|
|||
|
<comp.lang.php>
<gosha bine> <Wed, 15 Aug 2007 12:46:32 +0200> <46c2d9a4$0$11218$6e1ede2f@read.cnntp.org> > Try var_dump instead of echo add look what it says > www.outerlimitsfan.co.uk/bin.jpg Hadnt used var_dump before the above is the result . <?php $tvx=1; while ($tvx<7) { var_dump($broo[$tvx]); $zod=$broo[$tvx]; |
|
|||
|
<comp.lang.php>
<Rik> <Wed, 15 Aug 2007 12:47:04 +0200> <op.tw3j8qchqnv3q9@metallium> > I've reloaded your frontpage a couple of dozens of times, can't seem to > reproduce the error. > Most of the time it only happens the first time the page is looked at . -- (c) The Amazing Krustov |
|
|||
|
On Wed, 15 Aug 2007 15:05:39 +0200, Krustov <me@privacy.net> wrote:
> <comp.lang.php> > <Rik> > <Wed, 15 Aug 2007 12:47:04 +0200> > <op.tw3j8qchqnv3q9@metallium> > >> I've reloaded your frontpage a couple of dozens of times, can't seem to >> reproduce the error. >> > > Most of the time it only happens the first time the page is looked at .. Hmmm, according to the output you provided from a var_dump, it seems the variable is wrong in that case. Is your variable really created like: <?php $broo[1]="Internet Explorer"; $broo[2]="Firefox"; $broo[3]="Opera"; $broo[4]="Safari"; $broo[5]="Macintosh"; $broo[6]="Unknown"; ?> Or is it created in another way (and if so, how)? -- Rik Wasmus |