Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 587 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Other Programming Languages :

Check to see if a username is already registered

Thread title: Check to see if a username is already registered
Closed Thread    
    Thread tools Search this thread Display Modes  
06-03-2007, 11:11 PM
#1
Seraskier is offline Seraskier
Status: I love this place
Join date: Jan 2007
Location: Charlotte
Expertise:
Software:
 
Posts: 542
iTrader: 0 / 0%
 

Seraskier is an unknown quantity at this point

Send a message via AIM to Seraskier Send a message via MSN to Seraskier

  Old  Check to see if a username is already registered

Using ajax, how do you check if the username exists... by putting a check or x next to the text field depending on if its avaliable...

I know you have to use onkeyup but I need some help.

06-04-2007, 12:59 AM
#2
Seraskier is offline Seraskier
Status: I love this place
Join date: Jan 2007
Location: Charlotte
Expertise:
Software:
 
Posts: 542
iTrader: 0 / 0%
 

Seraskier is an unknown quantity at this point

Send a message via AIM to Seraskier Send a message via MSN to Seraskier

  Old

ok well i have moved to javascript and still cant get it to work.... i am trying this...

Code:
<?php include("include/config/connect.php"); ?>
<script language="text/javascript">
function display() 
{
	document.getElementById("available").innerHTML = window.form.username.value;
}
</script>

<form onKeyUp="display()" name="form">
	<input type="text" name="username">&nbsp;

<?php 
$available = "<div id='available'></div>";

$sql = mysql_query("SELECT * FROM users WHERE username='$available'");
$result = mysql_num_rows($sql); 
			
if ($result == "1")
	{
		echo "<img src='images/x.gif'>";
	}
	else
	{
		echo "<img src='images/check.gif'>";
	}
?>

</form>

06-04-2007, 03:29 PM
#3
localhost is offline localhost
localhost's Avatar
Status: Dediport Hosting
Join date: Jul 2006
Location: Berkshire
Expertise: programming, business
Software: Dreamweaver
 
Posts: 1,316
iTrader: 17 / 100%
 

localhost is on a distinguished road

  Old

Does that not work, Didn't think it would.

Basically you do it so when they have typed each character, a function is launched which checks in php and returns the result back to the javascript.. Maybe try a framework in ajax such as mootools and ask in their forums?

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed