Entry
Function for checkavailablity of a username when a user click a hyperlink
Jun 27th, 2006 02:18
vijesh Nair, Function for checkavailablity of a username when a user click a hyperlink
===================================================================
Java script Function for passing a value from one page to another(file
name say:index.php)
<script language="javascript">
function x()
{
var y=document.form1.t.value;
open("newtest.php?value="+y);
}
</script>
//Hyper link for check availablity
<a href="#" onclick="javascript:x();">checkavailablity</a>
====================================================================
2nd page access this value (say file name: newtest.php)
//after connecting to the database
$get_value=$_REQUEST['value'];
$query="select count(fname) as cv from pod.userdetails where
fname='$get_value'";
$result=mysql_query($query);
whille($row=mysql_fetch_array($result))
{
if($rows['cv']>=1)
{
echo "<font color='red'>Sorry username exist</font>";
}
else
{
echo "<font color='blue'>You can use this username</font>";
}
}//while