<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <form method="get" action="example.php"> Number : <input name="no"> <input type="submit" value="Persian"> </form> <? include("numper.class.php"); if (!empty($_GET["no"])){ $number = $_GET["no"]; // All you need to insert in your script is : $numper = new NumPer; $numper->Number = $number; $numper->num2per($numper->Number); } ?>