LIGHTENING YOUR WORKLOAD WITH (Tomcat web server) INCLUDES In other words,
Friday, November 30th, 2007LIGHTENING YOUR WORKLOAD WITH INCLUDES In other words, if the variable $imageSize hasn t been set (defined), the PHP engine will ignore everything between the curly braces. It doesn t matter that most of the code between the braces is XHTML and CSS. If $imageSize hasn t been set, the PHP engine skips to the closing brace, and the intervening code isn t sent to the browser. Many inexperienced PHP coders wrongly believe that they need to use echo or print to create XHTML output inside a conditional statement. As long as the opening and closing braces match, you can use PHP to hide or display sections of XHTML like this. It s a lot neater and involves a lot less typing than using echo all the time. If $imageSize has been set, the style block is created, and $imageSize[0] is used to set the correct width for the paragraph that contains the caption. 7. Save random_image.php and index.php, and reload index.php into a browser. Click the Reload button until the image of the trainee geisha with the mobile phone appears. This time, it should look like Figure 4-10. If you view the source code in the browser, you will see that the style rule changes automatically for each image. The correct width and height attributes should also be inside the tag. Figure 4-10. The ugly gap is removed by creating a style rule directly related to the image size. 111
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.