Thursday, September 4, 2014

SIMPLE LOGIN FORM USING PHP

<html>
<head>
<title>simple login form</title>
</head>
<body>
<form name="login" action="login.php"  method="POST">
   <input type="text" id="t1" name="t1" placeholder="enter your username">
   <br>
   <br>
   <input type="text"  id="t2" name="t2" placeholder="enter the password">
   <br>
   <br>
   <input type="submit" name="submit" value="submit" onClick="return valid()">
</form>
<script>
   var user="mickey";
   var pass="mouse";
   var x,y;
   function valid(){
     x=document.getElementById("t1").value;
     y=document.getElementById("t2").value;
          if(x==user && y==pass)
  return true;
  else
  return false;
    }
</script>
<?php
 $user=$_POST['t1'];
 $pass=$_POST['t2'];
       echo "welcome" .$user;
?>

</body
</html>
              

Wednesday, July 30, 2014

reversing a numerical value without using library functions in php

Observe the following error-free code to reverse the given number


<html>
<body>
<form method="POST" action="reverse.php">
<input type="text" name="t1" placeholder="enter a value">
<br>
<br>
<input type="submit" name="submit" value="reverse">
</form>
<?php
if(isset($_POST['submit']))
{
$val=$_POST['t1'];
$sum="";
$n=$val;
while($n!=0)
{
 $rem=$n%10;
 $sum.=$rem;
 $quo=$n/10;
 $n=floor($quo);
}
echo"the reversed value is".$sum;
}
?>
</body>
</html>

Tuesday, July 29, 2014

Decimal to binary conversion program in php

the following code will do the conversion of decimal to binary.....no error has been occured

<html>
<body>
<form method="POST" action="deci.php">
<input type="text" name="t1" placeholder="enter a value here">
<br>
<br>
<input type="submit" value="find" name="submit">
</form>
<?php
$sum="";
if(isset($_POST['submit']))
{
$val=$_POST['t1'];
$n=$val;
while($n!=0)
{
 $rem=$n%2;
 $sum.=$rem;
 $quot=$n/2;
 $n=floor($quot);
 
}


echo strrev($sum);

}
?>
</body>
</html>

Finding factorial values in php

<html>
<body>
<form name="hi" method="POST" action="factorial.php">
<input type="text" name="t1">
<br>
<br>
<input type="submit" value="submit">
</form>
<?php
$tot=1;
$num=$_POST['t1'];
for($i=$num;$i>0;$i--)
{
$tot=$tot*$i;
echo"<br>";
}
echo $tot;
?>
</body>
</html>

above code works well to find factorial....no error will occur

Adding digits in php

here is the code to get value from a text box and adds every digits of a number and prints total value

<html>
<body>
<form method="POST" action="adding.php">
<input type="text" name="t1" placeholder="enter a number">
<br>
<input type="submit" name="submit" value="go">
</form>
<?php
if(isset($_POST['submit']))
{
$val=$_POST['t1'];
$n=$val;
while($n!=0)
{
 $rem=$n%10;
 $sum+=$rem;
 $quot=$n/10;
 $n=$quot;
        }
echo "the added  value is:".$sum;
}
?>
</body>
</html>

the above code will work with no errors

getting multiple values from text box without reloading and adding them in php

Yesterday i tried that the below code to execute the task
getting multiple values from text box without reloading and adding them in php...and i executed it....it would work definitely 

<html>
<body>
<form method="POST" action="multi.php">
<input type="text" id="t1" name="t1" placeholder="enter numbershere" onKeyup="return myFunc(this.value)">
<br>
<input type="hidden" id="hidden" name="hidden" >
<br>
<input type="submit" name="submit" value="submit" onClick="myFunc1()">
</form>
<script>
var i=0;
var arr=new array(5);
function myFunc(val){
                         
var x=document.getElementById("t1");
                         if(isNaN(x.value))
                         return false; //returns if value is a character//
                         else{
                         arr[i]=x.value;
i++;
x.value="";
                            return true;
                             }
}
function myFunc1()
{
var y=document.getElementById("hidden");
y.value=arr;
}
</script>
<?php
if(isset($_POST['submit']))
{
$val=$_POST['hidden'];
$sum=0;
$no1;
$no2;
$no3;
$no4;
$no5;
sscanf($val,"%d,%d,%d,%d,%d",$no1,$no2,$no3,$no4,$no5);
if($no1!="")
$sum+=$no1;
if($no2!="")
$sum+=$no2;
if($no3!="")
$sum+=$no3;
if($no4!="")
$sum+=$no4;
if($no5!="")
$sum+=$no5;
echo $sum;
}
?>

</body>
</html>

in above coding, i have used keyup() function to avoid multiple submit buttons or multiple times loading a whole page...if you guys have any idea...please share it...

Monday, July 28, 2014

keyboard notes for vizhi moodi yosithaal song

song: vizhi moodi yosithal 

film: ayan

scale: G minor
4/8

pallavi:


Vizhi Moodi Yosithaal Angeyum Vanthaai Munnae Munnae
a#C   D D     D DD         DD  D D D    C D a# C


Thaniyaaga Pesidum Santhosam Thanthaai Pennae Pennae
a#C   D D     D DD         DD  D D D    C D a# C

Adi   Ithu Pol Mazhai Kaalam En Vaazhvil Varuma
a#C    D       G     F    E  D     C   C C     a# C   a

Mazhai Kiliyae Mazhai Kiliyae Un Kannai Kandaenae
a# a    a  g g g    a# a    a g g g gg   g  a  a#   D  C

Vizhi Vazhiye Vizhi Vazhiye Naan Ennai Kandaenae
a# a    a  g g g    a# a    a g g g gg   g  a  a#   D  C

Senthaenae
a# a  a#


charanam1:

Kadalaai Pesidum Vaarthaigal Yaavum Thuliyai Thuliyai Kuraiyum
a#  a      a    g   f   g g g   g       a#  a a  g       f g  g g Mounam Pesidum Bhasaigal Mattum Purinthidumae
a#  a      a    g   f   g g g   g       a#  a a  g       a# C D  C  D


Thaanai Enthan Kaalgal Irandum Unthan Thisaiyil 
Nadakkum
a#  a      a    g   f   g g g   g       a#  a a  g       f g  g g 
Thuram Naeram Kaalam Ellam Suringidumae
a#  a      a    g   f   g g g   g       a#  a a  g       a# C D  C  D

Intha Kaathal Vanthu Vittal, Nam Daegam Mithanthidumae
a#  C D    C     a#  a  a# a  g  a#  C D    C     a#  a  a# a  g

Vinnodum Mugiloodum Villaiyaadi Thirinthudumae
f g  a   a         f   g   a   aa    g     f    d        a

pallavi again
and repeat same  charanam  tones for charanam 2:

charanam 2:

Aasai Ennum Thoondil Multhaan Meenai Nenjai Izhukkum
Matti Køndapin Marupadi Matida Manam Thudikkum
Šuttrum Bhøømi Ènnai Vittu Thaniyai Šutri Parakkum
Nindral Nadanthaal Nenjil Yethø Puthu Mayakkam
Ithu Maaya Valaiallava Puthu Møana Nilaiallava
Udai Maarum Nadai Maarum Oru Paaram Ènnai Pidikkum        

pallavi