Monday, January 26, 2009

REPUBLIC DAY OF INDIA

Republic Day is India's great national festival. It is celebrated every year on January 26, in New Delhi with great pomp and pageant and in capitals of the States, as well as at other headquarters and important places with patriotic fervor.

India became a Republic and the constitution came into force on January 26, 1950. The Constituent Assembly was convened and appointed a committee with Dr. B.R.Ambedkar as Chairman to draft the Constitution. India declared herself to be a Sovereign Democratic Republic. The Indian Constitution, the longest in the world, consist 397 articles and 12 schedules which provides for a single citizenship for the whole of India.

"The Roots of Violence: Wealth without work, Pleasure without conscience, Knowledge without character, Commerce without morality, Science without humanity, Worship without sacrifice, Politics without principles" :
M.K Gandhi

I Wish you all a Happy Republic Day of India.

Sunday, January 25, 2009

About My Collage "NIT Calicut"


National Institute of Technology (NIT) Calicut is one of the premier institutes for technical education in India. NIT Calicut was formerly known as Calicut Regional Engineering College. The institute was established in September 1961 as the ninth of regional engineering college of India. In June 2002, Calicut Regional Engineering College was accorded the status of Deemed University and was renamed as National Institute of Technology Calicut.



Contact Address:

National Institute of Technology Calicut,
NIT Campus P.O., Calicut - 673 601.
Ph.No. 0495 2286101
Fax No. 0495 2287250
URL: www.nitc.ac.in

check username availability in ajax and php using jquery’s fading effect

Html Code :

User Name :
input name="username" type="text" id="username" value="" maxlength="15"/>
id="msgbox" style="display:none">

Css code :
.messagebox{
position:absolute;
width:100px;
margin-left:30px;
border:1px solid #c93;
background:#ffc;
padding:3px;

}
.messageboxok{
position:absolute;
width:auto;
margin-left:30px;
border:1px solid #349534;
background:#C9FFCA;
padding:3px;
font-weight:bold;
color:#008000;

}
.messageboxerror{
position:absolute;
width:auto;
margin-left:30px;
border:1px solid #CC0000;
background:#F7CBCA;
padding:3px;
font-weight:bold;
color:#CC0000;

}
.messageboxhold{
position:absolute;
width:auto;
margin-left:30px;
border:1px solid #CC0000;
background:#F7CBCA;
padding:3px;
font-weight:bold;
color:yellow
;
}

Javascript code :


$("#username").blur(function()
{
//remove all the class add the messagebox classes and start fading
$
("#msgbox").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
//check the username exists or not from ajax
$
.post("user_availability.php",{ user_name:$(this).val() } ,function(data)
{
if(data=='no') //if username not avaiable
{
document.form.username.value=null;
document.form.username.focus();

$
("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$
(this).html('This User name Already exists').addClass('messageboxerror').fadeTo(900,1);
});
}
else if(date=='yes')
{
$
("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$
(this).html('Username available to register').addClass('messageboxok').fadeTo(900,1);
});
}
else if(date=='amit')
{
$
("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{

$
(this).html('Plz enter Username ').addClass('messageboxhold').fadeTo(900,1);
});
}

});
});


Php Code:

$existing_users=array(amit,abhishek,kumar);
$user_name=$_POST['user_name'];
if($user_name==null)
{
echo "amit";
exit();
}
if (in_array($user_name, $existing_users))
{
//user name is not available
echo "no";
}
else
{
//username available i.e. user name doesn't exists in array
echo "yes";
}