Code Comments
Programming Forum and web based access to our favorite programming groups.
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
Post Follow-up to this message"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
Post Follow-up to this message> 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.
Post Follow-up to this message> 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, "-" "/" - "\".
Post Follow-up to this messagesa 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
Post Follow-up to this message> 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 ->
Post Follow-up to this messagesa 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
Post Follow-up to this messagesa 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
Post Follow-up to this messagesa 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
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.