Showing posts with label method. Show all posts
Showing posts with label method. Show all posts

Sunday, 30 March 2014

PHP TUTORIALS-POST METHOD

PHP TUTORIALS SESSION 3 POST METHOD WITH EXAMPLE PROGRAM 



HTML Program Name:- htmlpost1.html

<html>

<head>

<body>

<h1><center>Post Method</center></h1>

<form action="post1.php" method="post">

Name:<input type="text" name="name">

Email:<input type="text" name="email">

<input type="submit" value="Submit">

</form>

</body>

</head>

</html>


PHP Program Name:- post1.php


Welcome <?php echo $_POST["name"];?>

Your email id is:<?php echo $_POST["email"]; ?>


JAVA PROGRAMS-Method In Java Program

Method In Java Program

Program Name:- method.java


import java.io.*;

class circle

{

double radius;

final double pi=3.14;

circle(double r)

 {

 radius=r;

 }

double area()

 {

 return pi*radius*radius;

 }

double circum()

 {

 return 2*pi*radius;

 }

}

class cylinder extends circle

{

double hight;

cylinder(double r,double h)

 {

 super(r);

 hight=h;

 }

double area()

 {

 return circum()*hight;

 }

double volume()

 {

 return pi*radius*hight;

 }

}

class method

{

public static void main(String args[])

 {

 double area,area1,sectionarea,surfacearea,volume;

 circle cir=new circle(5.5);

 cylinder cy=new cylinder(3.2,12.5);

 area=cir.area();

 area1=cir.circum();

 System.out.println("\nArea of the circle of radius "+cir.radius+"\t:"+area);

 System.out.println("\nCircum ference of a circle\t:"+area1);

 System.out.println("\nCalculation for cylinder of radius "+cy.radius+" and height  "+cy.hight);

 surfacearea=cy.area();

 volume=cy.volume();

 System.out.println("\nSurface area\t"+surfacearea);

 System.out.println("\nVolume    \t"+volume);

 }

}