Sunday, 30 March 2014
JAVA PROGRAMS-Multi Level Inheritance in Java
Multi Level Inheritance in Java
Program Name:- multi.java
import java.io.*;
class box1
{
int length,width,height;
box1()
{
length=0;
width=0;
height=0;
}
box1(int l)
{
length=width=height=l;
}
box1(int l,int w,int h)
{
length=l;
width=w;
height=h;
}
int volume()
{
int v;
v=length*width*height;
return(v);
}
}
class boxweight extends box1
{
double weight;
boxweight()
{
super();
weight=0;
}
boxweight(int l,double m)
{
super(l);
weight=m;
}
boxweight(int l,int w,int h,double m)
{
super(l,w,h);
weight=m;
}
}
class shipping extends boxweight
{
double cost;
shipping()
{
super();
cost=0;
}
shipping(int l,double m,double c)
{
super(l,m);
cost=c;
}
shipping(int l,int h,int w,double m,double c)
{
super(l,w,h,m);
cost=c;
}
}
class multi
{
public static void main(String args[])
{
shipping s1=new shipping(10,5,7,100.1,150.2);
shipping s2=new shipping(5,2,10,20.0,115.50);
double vol1,vol2;
vol1=s1.volume();
vol2=s2.volume();
System.out.println("\n\t Shipping list");
System.out.print("\n\n Volume weight cost");
System.out.print("\n"+vol1+" "+s1.weight+"rs\t"+s1.cost);
System.out.print("\n"+vol2+" "+s2.weight+"rs\t"+s2.cost);
}
}
Monday, 3 March 2014
PHP TUTORIALS-Create Login Page with DataBase-PhpMyAdmin-Mysql
PHP TUTORIALS Create Login Page with DataBase-PhpMyAdmin-Mysql
FULL DETAILS..
PHP TUTORIALS-Create Login Page with Database using PhpMyAdmin-Mysql
PHP TUTORIALS Create Login Page with DataBase PhpMyAdmin Mysql PART2
Program Name :- htmllogin.html
<html>
<head>
<body bgcolor="">
<font>
<center><h1>Login</h1></center>
</font>
<form action="login.php" method="POST">
Username:<input type="text" name="uname">
Password:<input type="password" name="pass"><br>
<input type="submit" value="login" name="submit">
</form>
</body>
</head>
</html>
Program Name:- login.php
<?php
require ('sql_connect.php');
if (isset($_POST['submit'])){
$username=mysql_escape_string($_POST['uname']);
$password=mysql_escape_string($_POST['pass']);
if (!$_POST['uname'] | !$_POST['pass'])
{
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('You did not complete all of the required fields')
window.location.href='htmlogin.html'
</SCRIPT>");
exit();
}
$sql= mysql_query("SELECT * FROM `login_users` WHERE `username` = '$username' AND `password` = '$password'");
if(mysql_num_rows($sql) > 0)
{
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Login Succesfully!.')
window.location.href='htmllogin.html'
</SCRIPT>");
exit();
}
else{
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Wrong username password combination.Please re-enter.')
window.location.href='htmllogin.html'
</SCRIPT>");
exit();
}
}
else{
}
?>
Program Name:- sql_connect.php
<?php
mysql_connect("localhost", "root", "") or die("mysql connection is failure.");
mysql_select_db("login") or die("Database does not exists.");
?>
Labels:
-,
connect,
Create,
DataBase,
db,
FULL DETAILS,
html,
Login,
mydmin,
Mysql,
page,
PHP TUTORIALS,
PhpMyAdmin,
Program,
web,
with
Friday, 28 February 2014
PHP TUTORIALS-GET METHOD
CODING FOR GET METHOD WITH EXAMPLE PROGRAM SESSON-2
Program name:- htmlget1.php
<html>
<head>
<body>
<h1><center>GET METHOD</center></h1>
<form action="get1.php" method="get">
Name:<input type="text" name="name">
Email:<input type="text" name="email">
<input type="submit" value="submit">
</body>
</head>
</html>
get1.php
Welcome<?php echo $_GET["name"];?>
Your Email Address is: <?php echo $_GET["email"];?>
Labels:
connect,
Create,
DataBase,
db,
FULL DETAILS,
get,
give,
html,
HTML Program Name:- htmlgett1.html,
mydmin,
Mysql,
page,
PHP TUTORIALS,
PhpMyAdmin,
sql,
web
Subscribe to:
Posts (Atom)