Entry
Function for check-availablity of a username when a user click a hyperlink using javascript and php
Feb 28th, 2007 15:53
Articles Way, 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
======
www.dynamicdrive.com/forums/archive/index.php/t-14890.html
i hope that helps.
http://americanahost.com
http://www.qwesz.com