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:

banner for the css playlist in hebrew life michael courses for programmers

The First Steps in CSS

Learn CSS using our our videos (in Hebrew) on the CSS (he) playlist on youtube. Do it now. Do it for free.

Good Trainers Collaborate with Others

It is always essential to keep an open mind and learn from others. This applies to everyone, including teachers and especially software development trainers. Software

The Beauty of Code

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

Update cookies preferences