Search
 
SCRIPT & CODE EXAMPLE
 

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>
Comment

PREVIOUS NEXT
Code Example
Php :: Never return type - PHP 8.1 
Php :: get first row of array php 
Php :: register column types octobercms 
Php :: Modal Edit Specific/Same table row, where button is 
Php :: WordPress Plugin Code Definition 
Php :: encrypt number 
Php :: xampp pdoexception could not find driver 
Php :: search bar php progress 
Php :: php sum 2 arrays 
Php :: teaching php in interactive mode 
Php :: how to get many of quensation php programming language 
Php :: php find longest string in array 
Php :: php update json file 
Php :: laravel 8 storing dynamic checkbox integer value array 
Php :: laravel app not loading on server 
Php :: multiple submit button form to multiple php files 
Php :: Drupal sync directory in settings.php 
Php :: make_dpcust 
Php :: amazon linux 2 php.ini changes not working 
Php :: php Sum of all the factors of a number 
Php :: Add custom column at custom posts list 
Php :: php even odd 
Php :: how to stop message of laravel mix 
Php :: wordpress single_cat_title slug 
Php :: not have permision elgg settings.php 
Php :: laravel gigapay resend invite to employee 
Php :: GZIP COMPRESSION With PHP 
Php :: magento2 join table with prefix 
Php :: how to search locations in php using ajax google script 
Php :: create new laravel project 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =