Help to integrate Shell script with PHP

I have a shell script which takes user name and server name from the user and check the authentication type on that server like LDAP or VAS or local. It also provides various other info also such as owner of the ID and etc.
I need this script to work on the browser where user can directly input the values and get the output. For this I need to integrate my shell script with php or cgi.
Please help me in integrating it as I have not much idea in php.

I think you can use exec PHP function to run your script.
Don't forget to make it executable using chmod +x ./script.sh

<?php
$ouptut=`pwd`;
echo $ouptut;
?>