Hi I am trying to write my first loop to count and output pixels from (1,1,1) to (78,78,1)
this is the line i am trying to loop

<area shape="circle" coords="1,1,1" href="./index.html" target="_blank" alt="" yellow="">

how do i go about doing it please ?

Recommended Answers

All 4 Replies

Member Avatar for diafol

Not sure I follow you, but I'll give it a go...

$x = 1; $y = 1; $z = 1;$output = '';

for($x=1;$x<79;$x++)
{
    for($y=1;$y<79;$y++)
        $string = $x .','.$y.','.$z;
        $output .= '<area shape="circle" coords="'. $string . '" href="./index.html" target="_blank" alt="" yellow="">'
    }
}

echo $output;

It could do with a bit of tidying, but that's quite a few iterations.(6084?)

6084 is right, i am trying to get a box 78 x 78 pixels and have them flash a random colour with a randon link on each.

I am trying to put this code into the page and getting the output of the blackbox with the 1st pixel linked to the /index.php
also with

{ $x = 1; $y = 1; $z = 1;$output = ''; for($x=1;$x<79;$x++) { for($y=1;$y<79;$y++) $string = $x .','.$y.','.$z; $output .= '' } } echo $output;

under it,
this says to me that this code is not running when the page is loadded,
here is the full page

<html>
<head>

<title>Untitled Page</title>

<style type="text/css">
#ImageMap1
{
   border: 0px #000000 solid;
}
</style>
</head>
<body>
<div id="wb_ImageMap1" style="position:absolute;left:0px;top:0px;width:600px;height:600px;z-index:0;">

<img src="images/black.bmp" id="ImageMap1" alt="" usemap="#ImageMap1_map" border="0" style="width:600px;height:600px;">

<map name="ImageMap1_map">
{
    $x = 1; $y = 1; $z = 1;$output = '';
    for($x=1;$x<79;$x++)
    {
    for($y=1;$y<79;$y++)
    $string = $x .','.$y.','.$z;
    $output .= '<area shape="circle" coords="'. $string . '" href="./index.html" target="_blank" alt="" yellow="">'
    }
    }
    echo $output;

</map>
</div>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.