JAVASCRIPT BUG--PLEASE RELOAD
E-Mail
house
php logo

PHP BYTE BUDGET

These pages were made with a MSN webTV and are only viewable with a webTV. To see the pages on a computer you may download the WebTV viewer.
This is a tute on how to use PHP for gradtable art. You will need a PHP enabled server in order to create this type of table art.
OK, now for those who are familiar wtih javascript byte budget, here are the differences between the Javascript codes and the PHP codes. Basically, you can substitute any javascript byte table by changing a few codes.
JavascriptPHP
<script language="javascript"><? php
var a = "codes";
var b = "codes";
$a = "codes";
$b = "codes";
with(document){ write (a+b);echo $a, $b;
}</script>?>
NOTES ON PHP: You can use the tags <script language="php"> and </script>. It works fine when embedded in a html page. If you use the shortcut code however, the <?php, make certain that there is no space between the question mark and the word php, or you will get an error. Each ($) variable should begin on a new line and must be within quotes and end with a semicolon. Each echo call to a string of variables must begin on a new line. It does not seem to matter if there are spaces after the comma between echo'd string of $variable names. Again a semicolon is required at the end of each echo line. The file name should end with the extension php such as filename.php
ERROR CODES: These notes are spotty because this art is new and I do not really know what kind of problems can occur. I do know that if you leave out a semicolon, comma, or add a bracket or something that it does not recognize, you will get an error message. It may say something like, Parse error, unexpected T variable on line 7. In this case you will have to go back in to the file to correct the error.
A fatal error can occur also, and depending on your server, either nothing will seem to happen or you will get a message saying that it is a kind of information that can't be used. You can contact your server administration about your server's handling of error messages. In either case, if this happens, correct the error, and then you must change the filename to clear the cache. So it might be a good idea to give it a temporary name to begin with. Then when you have completed your table art, give it its permanent name.
Because PHP byte budget is very similar to javascript byte budget, I have done these tables first in javascript and then transfomed the same code to php to show the similarities in coding. The $name = "codes"; is called a string. If you are not familiar with Byte budget in coding and do not have access to a php server, please check these two sites for more information. jawjahboy.com and Javascript Jungle You can also learn more about php using the GD library by going to another one of Sally's sites at PHP/GD
Here are 3 gradtables with a link to the Javascript and PHP codes. This is done to show the various ways of using one script by modifying it as you choose to create another image, and then combining them on a page.
JS AND PHP BYTE CODES
This next table uses all the variables above except the audioscope, with one spacing variable added on and then written out differently.
Here is the final version of the same code with a few changes involving the width and the way the angles are written. There is an extra variable written for the width as well as the closing tag for the width variable. The widths are written in to the write() code within quotes. Anything that you don't have a variable for can be written in to the write code so long as it is in quotes. You can nest a table in quotes. Each line too is a table by itself, and then stacked.
Finally, here are two versions of the same table art image showing a combination of all the codes combined in to an image, resized, and manipulated slightly. One page has each php script written out fully as a stand alone script. The other is a shorter form of the PHP codes using strings from other scripts that are duplicated. It appears that both ways work equally well.
PHP IMAGELONG PHP CODES
PHP IMAGESHORT PHP CODES
If you do create an image with a lot of scripts or nested tables, I would advise that you do each one separately at first to be sure there are no errors, before combining the scripts on to a page. You can spend hours trying to find an error when just the CSS does not appear to be working. But it could be something as simple as not closing a nest properly.
If you source your page it will appear as a html page. If you would like to display your php text, CCP your codes and put them on another page with a txt (filename.txt) extension in the file name. Then post that URL with your image. The txt code may not have the proper breaks but if you know the rules you can figure out the code.
It also appears that the Javascript Bug won't be striking these pages.
>{8-()


© June, 2006
Linda