<font color="aqua"size="5">Please Reload</font





LOOP De LOOP




Gradtable shapes can be formed by using PHP loops. Just like midi loops PHP loops do a particular thing a specified number of times. Not only can we specify the number of times but we can also specify other things to happen with each loop.

The cone shape is basic to gradtables and is one table under the other with the td cells widened with every table. A loop will do that. You start by giving the width a starting place. $width=4; Now wherever the variable $width is used it means 4. Used in the td cell, it will look like this: td bgcolor=000000 gradcolor=ff0000 height=3 gradangle=90 width=$width.

So we write a regular two cell gradtable with 90 and -90 angles and use $width for the widths starting our cone at 8 pixels across total. We want our cone to end with 50 pixels wide for each cell or 100 pixels total. So we tell the server that while the width is less than 50, add 2 pixels to the width each loop and stop when the width reaches 50 pixels.

It is written like this: while ($width <= 50 ) { $width = $width + 2; Therefore each table will increase by 4 pixels wide going from 8 to 12 to 16 to 20....all the way to 50. It will then stop. And we write the same two cell table code for the server to use. This code is delivered to the server by the echo command which means "execute the HTML code; and execute it enough times to reach a width of 50 for each cell".








We can reverse the process by starting the $width at 50 and instructing it to take away 2 pixels each time till 4 is reached.

It is written like this: while ($width >= 4 ) { $width = $width - 2; Therefore each table will decrease by 4 pixels wide going all the way to 4. It will then stop.







Here is a text page with the codes for both directions. Just copy it and give it a php extension.

Codes


Change colors, and angles, change the height and change the $width..and see what you get. Put the packets of PHP code into td cells and string them across the page...add more td cells....just play and see what happens.

Remember to always keep the original so if you mess it up you can start over for another try....!!



Here are some more loop examples with code:

Looper  Image  Alternate 




You must have a server that allows PHP scripting. The following page contains PHP info for various servers.

Servers


For hosts not listed, contact your host provider.






TooTs