PHP Tutorials: jQuery: Check if a username is available without refreshing

PHP Tutorials: jQuery: Check if a username is available without refreshing
Want more? Explore the library at https://www.codecourse.com/lessons

Official site


RRelated Posts


    Thank you .I love you
  • Undine Duke
    Hi, thanks for the tutorial but I am having some issues. The php part is not working inside of the function block, all preliminary test with the javascript works fine however, when i start the PHP it stops working. Initially I got the undefined index error and I used the if isset but still, I haven't received the desired result. Can you assist in any way...i would be grateful.
  • Benjamin Henry
    if you made the code available I would be much more inclined to follow. Can't check my mistakes against your code.
  • EnzO Amodia Jr.
  • chris leo
    why are your tutorial codes hidden? i think it should be where your followers can be able to see it, download it and be able to test it should just following live tutorials doesn't work for them. just saying cause i followed your tutorial on this but after the first three lines of code it doesn't work, and there's no way of me checking yours with mine to see where what went wrong
  • iluke95
    even your tutorials from 2010 are top notch, keep doing what you're doing!
  • I'm Awesome!
    Notice: Undefined index: username in C:\xampp\htdocs\medcares\check.php on line 2
    that's what it says when I refresh my page. please tell me how can i fix it
  • Satya Narayana
    what does the jquery.js file contain?
  • Nayandeep Yadav
    What changes do we need to make for using this method in a professional website?
  • 1chocolu
    What if I put in the SQL query to submit the username to the database within that IF function? Will that go automatically? I wanna have to press a "submit the form button" before that info goes through.
  • DarkCyb3r
    Sir, please help me. I'm Stuck and i really need this for my final project. I'm stuck at when you want to test your $('#feedback').html(result).show(); , i got the error of undefined index but i manage to remove the error with solution from the comment section(thank you) but i didn't get anything when i typed in the username textbox. When i remove everything inside the check.php and type something like aasdasd , it appeared on my index.php but when i use the php code echo $username = $_POST['username']; nothing appear or happen on my index.php.
  • buddyroach
    this is cool and all but its not working for me. neither is anything else. i have been at this for weeks and cant fucking figure it out.
  • buddyroach
    it keeps thinking a NULL is given.
    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in E:\wamp\www\phpscripts\signup.php on line 85
  • McDonald Ilondu
    i'm using WAMP server 2.0 and i tried to show dummy data from check.php but its not displaying! what seems to be the problem?
  • Sujon Chondro Shil
    Vary helpful. Thank you. But how can i disable the submit button if the name already exist? It will be really helpful if you suggest any solution.
  • John Paul Lim Gabule
    Thank Again Sir. Amazing tutorial as always. Your a giver :)
  • paktongko90
    worked!! but i have button to submit the form to sql. how do i disable the submit button when username is not available?
  • Webslesson
  • Abrar Zahin
    thanks a lot!
  • Arnolfo Federis
    great but how can i disable button if it is too short
  • Rafaello Meneses
    not working........... and do i need this to work jquery.js
  • fl366
  • Paradox Life
    im having problems adding one more field can anyone help me im trying to add email is available 
  • pta2002
    i cant get it to work
  • bdboy
    this is excellent tutorial....But there is something Unreadable(look so bad) by default in feedback div. although i works 100%.
  • Shuaib Mohamed
    Nice tutorial but my page display by default

    Notice: Undefined index: username in    check.php on line 3
  • Ram prashanth
     Notice: Undefined variable: _post in C:\wamp\www\new project\check.php on line 4
    error is showing on webpage how to resolve it
  • James Erikson
    Also, can't you do mysql_query("SELECT username FROM mydatabase.users") instead of having the mysql_db_select??
  • James Erikson
    What about putting the scripts at the end of the page? Nice tutorial though, thanks!
  • Sachin F
    Is it possible to do this for two different fields with two different divs using the same check.php. Great video. Thanks
  • Sachin F
    Is it possible to do this for two different fields with two different divs using the same check.php. Great video. Thanks
  • Ian Rey
    could someone help me on this.
    When the page loads for the 1st time, it always show this Notice msg: 
    "Notice: Undefined index: username"
    but when I wrote something on the textbox, it disappear.
    how could I fix this?
  • John Ink
    I'm sure you misspoke, but I think # in css indicates that feedback is an id, not a div.
  • Che Sun
    i'm using WAMP and i tried to show dummy data but doesnt work! i dont know why ?? i have to install other tools to read jquery??
  • MrProMilkyBarKid
    if anyone Is having problems with this code, change the document.ready(function()) to just $function() That worked for me
  • James Erikson
    Although, @reigngel is right as well.
  • James Erikson
    Just a quick update... I tried implementing this to my site but, I got an error of "value" is not defined... So I went through the coding again and found that, you have to have "document.formname.fieldID.value" instead of "formname.fieldID.value"...
  • James Erikson
    Awesome description! I use this on my website now :)
  • James Erikson
    You're the best! This is the only explanation that has made sense to me! thanks!! :D
  • Shreepathi GM
    very nice sir.
  • panos gavalas
    Lets say you had a submit button next to the username field, Depending on the availability of the username, is there a way to disable / enable the use of the submit button? Thanks for all your effort.
  • ky luc
    Lập trình Web với PHP & MySQL PHP (Hypertext Preprocessor) là ngôn ngữ lập trình script rất thông dụng, được dùng để phát triển các ứng dụng mã nguồn mở, chạy trên máy chủ. Điều thú vị đối với PHP là nó có thể được nhúng vào trang HTML rất dễ dàng. Để hiểu thêm về môn học này cũng như tìm hiểu thêm về môn học, bạn vào athena.edu.vn để tìm hiểu thêm.
  • Amre M
    Thanks a lot.. insta like + favourite + subcribe !!
  • demon6937
    tnx man its working more simpler than ajax
  • flyingshows
    say God is the best. because he created Alex's Brain :-) twitter @ niyazsky
  • Alin E.
    I think there could be a resource problem on big websites since this does a mysql SELECT on each input to the field.
  • reo javier
    nice tutorial
  • AreNyK
    what if i want send more post variables for check.php via that javascript code. is it : $.post('check.php', { username:form.username.value , var2:value}, function(result)) { } ???????
  • Fredy Kee
    thank you very much!!! You're brilliant!
  • Jorge Sotelo
    Excellent tutorial! Easy to follow. Thanks,