Help - Search - Member List - Calendar
Full Version: [GD] Troubles
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
sa
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

Oli Filth
sa wrote:
QUOTE
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

Kimmo Laine
"sa" <[Email Removed]> kirjoitti
viestiss:xJ9ae.79229$[Email Removed]...
QUOTE

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

[Email Removed]

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

QUOTE
What are you trying to achieve with this script?

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

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

Oli Filth
sa wrote:
QUOTE
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, "-" "/" - "".


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


--
Oli

sa
QUOTE
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 ->

Flav
I am running a cms demo site, mainly though not limited to PHP-Nuke and
it's forks.

What I am trying to do, though not having much luck is have my demo
sites totally erased every 2 hours and have it rebuilt via a cronjob.

What it need to do is:
Delete the dir
recreate the dir and extract a gzip file
delete a mysql database
re-import a sql file and rebuild the database

I want to have this all automated via a cronjob.

If anyone could help me I would be greatly appreciated, and all credits
will be given and advertised on our site.

Paul
Nuke Choice
http://www.nuke-choice.com

Flav
Flav wrote:
QUOTE
I am running a cms demo site, mainly though not limited to PHP-Nuke and
it's forks.

What I am trying to do, though not having much luck is have my demo
sites totally erased every 2 hours and have it rebuilt via a cronjob.

What it need to do is:
Delete the dir
recreate the dir and extract a gzip file
delete a mysql database
re-import a sql file and rebuild the database

I want to have this all automated via a cronjob.

If anyone could help me I would be greatly appreciated, and all credits
will be given and advertised on our site.

Paul
Nuke Choice
http://www.nuke-choice.com

Sorry, wrong spot.
Don't know what happened there


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.