Strange effect

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-15-2007
Krustov
 
Posts: n/a
Default Strange effect

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>&nbsp;</td>";
print "<td class=vva>$zod</td>";
print "<td class=bba>&nbsp;</td>";
print "<td>$hippy1</td>";
print "<td align=right class=ppa>$curd[$tvx]</td>";
print "<td class=ppa>$uzi</td>";
print "<td class=bba>&nbsp;</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>&nbsp;</td>";
print "</tr>";
$tvx=$tvx+1;
}
?>
</table>
Reply With Quote
  #2 (permalink)  
Old 08-15-2007
gosha bine
 
Posts: n/a
Default Re: Strange effect

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>&nbsp;</td>";
> print "<td class=vva>$zod</td>";
> print "<td class=bba>&nbsp;</td>";
> print "<td>$hippy1</td>";
> print "<td align=right class=ppa>$curd[$tvx]</td>";
> print "<td class=ppa>$uzi</td>";
> print "<td class=bba>&nbsp;</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>&nbsp;</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
Reply With Quote
  #3 (permalink)  
Old 08-15-2007
Rik
 
Posts: n/a
Default Re: Strange effect

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
Reply With Quote
  #4 (permalink)  
Old 08-15-2007
Krustov
 
Posts: n/a
Default Re: Strange effect

<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];

Reply With Quote
  #5 (permalink)  
Old 08-15-2007
Krustov
 
Posts: n/a
Default Re: Strange effect

<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
Reply With Quote
  #6 (permalink)  
Old 08-15-2007
Rik
 
Posts: n/a
Default Re: Strange effect

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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:03 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0