Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

user input in oop php

<?php

class demo

{

function add($a,$b)

{   

$sum=$a+$b;

echo "Sum=".$sum."<br/>";	

}

function sub($x,$y)

{

$sub=$x-$y;

echo "Subtraction=".$sub;	

}

}

$obj= new demo();

$obj->add($_GET['f'],$_GET['s']);

$obj->sub($_GET['f'],$_GET['s']);

?>
  
<form>

Enter first number<input type="text" name="f"/><hr/>

Enter second number<input type="text" name="s"/><hr/>

<input type="submit" value="Show result"/>

</form>
Source by www.phptpoint.com #
 
PREVIOUS NEXT
Tagged: #user #input #oop #php
ADD COMMENT
Topic
Name
6+9 =