![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 399 Pomógł: 7 Dołączył: 11.06.2007 Skąd: Poznan Ostrzeżenie: (20%) ![]() ![]() |
Jakie zrobić zapytanie do bazy danych które jako wynik poda mi prawdę bądź fałsz.
Jeżeli taki użytkownik jest w bazie to niech zwróci fałsz, jeżeli nie ma to niech zwróci prawdę. Ten post edytował JaRoPHP 23.12.2007, 20:07:39
Powód edycji: Poprawa ortografii.
|
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 399 Pomógł: 7 Dołączył: 11.06.2007 Skąd: Poznan Ostrzeżenie: (20%) ![]() ![]() |
Próbowałem tak i mi nie idze, cały czas ten błąd 2
Kod <script>
function checkLogin (name) { var ajaxRequest = false; var NO = 'NO'; var YES = 'YES'; if (window.XMLHttpRequest) { ajaxRequest = new XMLHttpRequest (); if (ajaxRequest.overrideMimeType) { ajaxRequest.overrideMimeType ('text/xml'); } } else if (window.ActiveXObject) { try { ajaxRequest = new ActiveXObject ("Msxml2.XMLHTTP"); } catch (exception) { ajaxRequest = new ActiveXObject ("Microsoft.XMLHTTP"); } } ajaxRequest.open ('GET', 'check.php?login=' + name, true); ajaxRequest.onreadystatechange = function () { if (ajaxRequest.readyState == 1) { document.getElementById('spr').style.color = 'blue'; document.getElementById('spr').innerHTML="Sprawdzanie..."; } else if (ajaxRequest.readyState == 4) { if (ajaxRequest.status == 200) { if (ajaxRequest.responseText == YES) { document.getElementById('spr').style.color = 'red'; document.getElementById('spr').innerHTML="Login jest już zajęty."; } else if (ajaxRequest.responseText == NO) { document.getElementById('spr').style.color = 'green'; document.getElementById('spr').innerHTML="Login poprawny i dostępny."; } else { document.getElementById('spr').style.color = 'black'; document.getElementById('spr').innerHTML='Błąd 2'; } } else { document.getElementById('spr').style.color = 'black'; document.getElementById('spr').innerHTML="Błąd 3"; } } }; ajaxRequest.send (null); } </script> Ten post edytował Piotrwusek 24.12.2007, 20:39:25 |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.08.2025 - 18:18 |