Sunday 26 August 2018

OOP INTRODUCTION IN PHP





Source code :



<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>OOP-1</title>

</head>



<body>

<?PHP

class books

{

var $title; // member variable.....

var $price ; // member variable.....





function setTitle($para)

{

$this->title=$para;

} //set method.....



function getTitle()

{

echo $this->title."<br/>";

} //get method.............

//...............................................



function setPrice($para)

{

$this->price=$para;

} //set method.....



function getPrice()

{

echo $this->price."<br/>";

} //get method.............

} //class end...................





$physics= new books; //class instance or object........



$physics->setTitle("Physics for XII");

$physics->setPrice(150);



echo "Title of Book is : ";

$physics->getTitle();

echo  "Price of the book is ";

$physics->getPrice();





?>









</body>

</html>

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...