Debugging PHP Web Application using Zend Studio

Zend Studio makes things very simple when it comes to debugging web applications that were developed in PHP. The following code sample include two files.

The first presents a simple form to the user that allows him to enter the width and the height of a specific rectangle.

<form method="get" action="index.php">
width: <input type="text" name="width">
<br>
height: <input type="text" name="height">
<br>
<input type="submit">
</form>

When pressing submit a request is sent to the second PHP document that calculates the area and the perimeter.

<?php
$width = $_GET['width'];
$height = $_GET['height'];
//$width = 7;
//$height = 9;
$area = $width * $height;
$perimeter = 2 * ($width+$height);
echo "<br>area=$area";
echo "<br>perimeter=$perimeter";
?>

The bar shown on the bottom of the web browser allows us to debug both the first page and the second one. The following video clip shows how to use this intutitive debugger.

You can find more code samples and video clips for learning PHP and for learning how to use the Zend Studio in my free online courses at http://abelski.lifemichael.com.

Share:

The Visitor Design Pattern

The Visitor Design Pattern

The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.

What are Anti Patterns?

Anti Patterns

Unlike design patterns, anti patterns just seem to be a solution. However, they are not a solution and they cause additional costs.

Virtual Threads in Java Professional Seminar

Virtual Threads in Java

The use of virtual threads can assist us with improving the performance of our code. Learn how to use virtual threads effectively.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences