Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

[GD] Troubles
Hi all,

i'm not able to explain the behaviour of browsers internet explorer and
mozilla firefox with that script:

<table width="680" height="400" align="center" border=1><tr><td>
<table border="0">
<?
for($j=0;$j<30;$j++)
{
echo "<tr align=\"top\">";
for($i=0;$i<60;$i++)
{
echo "<td><img src=\"gen_row.php?x2=0&y2=0&x1=0&y1=0\"></img></td>";
}
echo "</tr>";
}
?>

gen_row.php file draw lines

$x2 = $_GET["x2"];
$y2 = $_GET["y2"];
$x1 = $_GET["x1"];
$y1 = $_GET["y1"];
header("Content-type: image/png");
$im = @imagecreate(10, 10)
or die("Cannot Initialize new GD image stream");
$background = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
imageline($im, $x2, $y2, $x1, $y1, $black);
imagepng($im);
imagedestroy($im);
?>

With internet explorer time to time it works, other time browser get mad and
neither find the file.
With firefox it seems to work but time to time it don't create all columns
and rows cause script terminate before the end.

Any help is apprecciated.

Salvatore



Report this thread to moderator Post Follow-up to this message
Old Post
sa
04-25-05 01:55 AM


Re: [GD] Troubles
"sa" <sa1230usr@libero.it> kirjoitti
viestissä:xJ9ae.79229$zZ1.2198586@twister1.libero.it...
>
> Hi all,
>
> i'm not able to explain the behaviour of browsers internet explorer and
> mozilla firefox with that script:
>
> <table width="680" height="400" align="center" border=1><tr><td>
> <table border="0">
> <?
> for($j=0;$j<30;$j++)
> {
>  echo "<tr align=\"top\">";
> for($i=0;$i<60;$i++)
> {
> echo "<td><img src=\"gen_row.php?x2=0&y2=0&x1=0&y1=0\"></img></td>";
> }
> echo "</tr>";
> }
> ?>
>
> gen_row.php file draw lines
>
> $x2 = $_GET["x2"];
> $y2 = $_GET["y2"];
> $x1 = $_GET["x1"];
> $y1 = $_GET["y1"];
> header("Content-type: image/png");
> $im = @imagecreate(10, 10)
>    or die("Cannot Initialize new GD image stream");
> $background = imagecolorallocate($im, 255, 255, 255);
> $black = imagecolorallocate($im, 0, 0, 0);
> imageline($im, $x2, $y2, $x1, $y1, $black);
> imagepng($im);
> imagedestroy($im);
> ?>
>
> With internet explorer time to time it works, other time browser get mad
> and
> neither find the file.
> With firefox it seems to work but time to time it don't create all columns
> and rows cause script terminate before the end.
>
> Any help is apprecciated.
>


Don't know if this helps anything, but there's no closing tag </img> for
img.

--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears

eternal.erectionN0@5P4Mgmail.com



Report this thread to moderator Post Follow-up to this message
Old Post
Kimmo Laine
04-25-05 01:55 AM


Re: [GD] Troubles
> Don't know if this helps anything, but there's no closing tag </img> for
> img.

I already tried closing </img> but its the same. I think could be something
what Oli Filth was saying..
i need to try.

Thank you all.



Report this thread to moderator Post Follow-up to this message
Old Post
sa
04-25-05 01:55 AM


Re: [GD] Troubles
> 30 x 60 = 900. I dunno if this is the cause, but 900 simultaneous
> requests on a server is quite a serious load. Not to mention the
> rendering pressure this puts on the browser, and the fact that your HTML
> will be over 55K!

Ok, i must try reducing the numbers of rows/colums..lets try.

> What are you trying to achieve with this script?

Its a graph...every td can contain, "-" "/" - "\".





Report this thread to moderator Post Follow-up to this message
Old Post
sa
04-25-05 01:55 AM


Re: [GD] Troubles
sa wrote: 
>
>
> Ok, i must try reducing the numbers of rows/colums..lets try.
>
> 
>
>
> Its a graph...every td can contain, "-" "/" - "\".
>

Can't you just generate the graph as a single image rather than 900
separate images?


--
Oli

Report this thread to moderator Post Follow-up to this message
Old Post
Oli Filth
04-25-05 01:55 AM


Re: [GD] Troubles
> Can't you just generate the graph as a single image rather than 900
> separate images?

Thank you for the hint!
I'll try this way ->




Report this thread to moderator Post Follow-up to this message
Old Post
sa
04-25-05 01:55 AM


Re: [GD] Troubles
sa wrote:
> Hi all,
>
> i'm not able to explain the behaviour of browsers internet explorer and
> mozilla firefox with that script:
>
> <table width="680" height="400" align="center" border=1><tr><td>
> <table border="0">
> <?
> for($j=0;$j<30;$j++)
> {
>   echo "<tr align=\"top\">";
>  for($i=0;$i<60;$i++)
>  {
>  echo "<td><img src=\"gen_row.php?x2=0&y2=0&x1=0&y1=0\"></img></td>";
>  }
>  echo "</tr>";
> }
> ?>
>

30 x 60 = 900. I dunno if this is the cause, but 900 simultaneous
requests on a server is quite a serious load. Not to mention the
rendering pressure this puts on the browser, and the fact that your HTML
will be over 55K!

What are you trying to achieve with this script?


--
Oli

Report this thread to moderator Post Follow-up to this message
Old Post
Oli Filth
04-25-05 08:56 AM


Re: [GD] Troubles
sa wrote:
> Hi all,
>
> i'm not able to explain the behaviour of browsers internet explorer and
> mozilla firefox with that script:
>
> <table width="680" height="400" align="center" border=1><tr><td>
> <table border="0">
> <?
> for($j=0;$j<30;$j++)
> {
>   echo "<tr align=\"top\">";
>  for($i=0;$i<60;$i++)
>  {
>  echo "<td><img src=\"gen_row.php?x2=0&y2=0&x1=0&y1=0\"></img></td>";
>  }
>  echo "</tr>";
> }
> ?>
>

30 x 60 = 900. I dunno if this is the cause, but 900 simultaneous
requests on a server is quite a serious load. Not to mention the
rendering pressure this puts on the browser, and the fact that your HTML
will be over 55K!

What are you trying to achieve with this script?


--
Oli

Report this thread to moderator Post Follow-up to this message
Old Post
Oli Filth
04-27-05 08:56 AM


Re: [GD] Troubles
sa wrote: 
>
>
> Ok, i must try reducing the numbers of rows/colums..lets try.
>
> 
>
>
> Its a graph...every td can contain, "-" "/" - "\".
>

Can't you just generate the graph as a single image rather than 900
separate images?


--
Oli

Report this thread to moderator Post Follow-up to this message
Old Post
Oli Filth
04-27-05 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:23 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.