Okay you can't echo anything out, anything you're using echo statements for needs to be set to a variable or directly placed in your template.
For example, this could be removed from the script and placed in the template:
Code:
Enter the IP Address or domain name of the server that you want to ping.<br>
<form method='post' action='ping.php?do=ping'><input type='text' name='domain' value=''> <input type='submit' value='Ping'></form>