Oto kod js
<script type="text/javascript"> function mistrzostwa(){ var czy = document.forms['nowy'].elements['czy'].checked; var el; var el2; el2 = document.getElementById('textdodaj'); el = document.getElementById('mistrzostwa'); if(czy){ } else{ el.innerHTML = ''; el2.innerHTML = ''; } }z function funkcja(){ var error=true; var wyslij; var haslo1 = document.forms['nowy'].elements['haslo'].value; var haslo2 = document.forms['nowy'].elements['haslo2'].value; var formularz = document.forms['nowy'].elements['login'].value; var regulamin = document.forms['nowy'].elements['regulamin'].checked; var ajaxRequest; try{ ajaxRequest = new XMLHttpRequest(); } catch (e){ try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("Twoja ptzeglądarka nie obsługuje AJAX'a!"); return false; } } } ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var zmienna = ajaxRequest.responseText; if(zmienna == 1){ var el; el = document.getElementById('zle'); el.innerHTML = 'Nazwa urzytkownika jest już zajęta!'; } else{ if(haslo1==haslo2){ if(regulamin){ var el; el = document.getElementById('zle'); el.innerHTML = ''; el = document.getElementById('zle1'); el.innerHTML = ''; el = document.getElementById('zle2'); el.innerHTML="" ; error=false; } else{ var el = document.getElementById('zle2'); el.innerHTML="Musisz zaakceptować regulamin!" } } else{ el = document.getElementById('zle1'); el.innerHTML = 'Podane hasła się różnią!'; document.forms['nowy'].elements['login'].disabled="disabled"; } } } else{ } if(error){ return false; } if(!error){ return true; } } ajaxRequest.open("GET", 'mysql_uzytkownik.php?login='+formularz+'', error); ajaxRequest.send(null); } </SCRIPT>
a oto formularza
Prosze o pomoc. Męczę się z tym od wczoraj

Zmieniłem kod ale i tak nie działa. Wykonałem już ok 100 różnych kombinacji. Oto teraźniejszy kod
<?session_start(); ob_start(); $ilpoczta=0; $login=$_SESSION['login']; $zamiana = array('ą', 'Ą', 'ć', 'Ć', 'ł', 'Ł', 'ó', 'Ó', 'ś', 'Ś', 'ę', 'Ę', 'ń', 'Ń', 'ż', 'Ż', 'ź', 'Ź', '' ); $cenzura = array('^a^', '^A^', '^c^', '^C^', '^l^', '^L^', '^o^',' ^O^', '^s^', '^S^', '^e^', '^E^', '^n^', '^N^','^z^', '^Z^','^x^','^X^', '^*c*^'); $tytul =str_replace( $cenzura, $zamiana, $tytul ); $klucze =str_replace( $cenzura, $zamiana, $klucze ); $opis =str_replace( $cenzura, $zamiana, $opis ); $name='index'; mysql_connect('localhost', 'epamiec_robal94', 'logika94'); mysql_select_db('epamiec_epamiec'); $zapytanie=mysql_query("select * FROM klucze WHERE name='$name'"); while($row = mysql_fetch_array($zapytanie)){ $opis= str_replace( $cenzura, $zamiana, $row['opis']); $klucze= str_replace( $cenzura, $zamiana, $row['klucze']); $tytul = str_replace( $cenzura, $zamiana, $row['tytul']); $tresc = str_replace( $cenzura, $zamiana, $row['tresc']); } $cz1 = fread(fopen("index1.php", "r"), filesize("index1.php")); $cz2 = fread(fopen("index2.php", "r"), filesize("index2.php")); $cz3 = fread(fopen("index3.php", "r"), filesize("index3.php")); $log1 = fread(fopen("log1.php", "r"), filesize("log1.php")); $log2 = fread(fopen("log2.php", "r"), filesize("log2.php")); $poczta=mysql_query("select status From poczta Where adresat='$login'"); while($row = mysql_fetch_array($poczta)){ if($row['status'] == 1){ $ilpoczta++; } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//PL"> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="Description" content="<?echo $opis?>"/> <meta name="Keywords" content="<?echo $klucze;?>"/> <meta http-equiv="Content-Language" content="pl" /> <meta name="Author" content="Tobiasz Boral"/> <meta name="Robots" content="all"/> <link rel="stylesheet" href="style.css" type="text/css"/> <link rel="shortcut icon" href="gif/epamiec.ico" type="image/x-icon"/> <script type="text/javascript"> function mistrzostwa(){ var czy = document.forms['nowy'].elements['czy'].checked; var el; var el2; el2 = document.getElementById('textdodaj'); el = document.getElementById('mistrzostwa'); if(czy){ } else{ el.innerHTML = ''; el2.innerHTML = ''; } } function funkcja(){ dobre = false; var wyslij; var haslo1 = document.forms['nowy'].elements['haslo'].value; var haslo2 = document.forms['nowy'].elements['haslo2'].value; var formularz = document.forms['nowy'].elements['login'].value; var regulamin = document.forms['nowy'].elements['regulamin'].checked; var ajaxRequest; try{ ajaxRequest = new XMLHttpRequest(); } catch (e){ try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("Twoja ptzeglądarka nie obsługuje AJAX'a!"); return false; } } } ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ zmienna = ajaxRequest.responseText; return zmienna; } } ajaxRequest.open("GET", 'mysql_uzytkownik.php?login='+formularz+'', true); ajaxRequest.send(null); if(zmienna == 1){ var el; el = document.getElementById('zle'); el.innerHTML = 'Nazwa urzytkownika jest już zajęta!'; dobre=false; } else{ if(haslo1==haslo2){ if(regulamin){ var el; el = document.getElementById('zle'); el.innerHTML = ''; el = document.getElementById('zle1'); el.innerHTML = ''; el = document.getElementById('zle2'); el.innerHTML="" ; dobre=true; } else{ var el = document.getElementById('zle2'); el.innerHTML="Musisz zaakceptować regulamin!" dobre=false; } } else{ dobre=false; el = document.getElementById('zle1'); el.innerHTML = 'Podane hasła się różnią!'; document.forms['nowy'].elements['login'].disabled="disabled"; } } return dobre; } </SCRIPT> </HEAD> <BODY onLoad="onload();" > <?echo $cz1;?> <div id="logowanie"> <?php if($_SESSION['status'] == 0){ echo $log1; } elseif($_SESSION['status'] > 0){ } ?> </div> <?echo $cz2;?> <div id="srodek"> <div id="text"> <div id="nazwy">Nazwa urzytkownika*:<br>Hasło*:<br>Powtórz hasło*:<br>E-mail*:<br>Imię:<br>Nazwisko:<br>Gadu-gadu:<br>Chcę aby mój mail był<br>widoczny dla innych urzytkowników<br>Brałem udział w "Polish <br>Open Memory Championship"(junior, children)<br><div id="textdodaj"></div><br>Akceptuje <a href="regulamin.php">regulamin</a></div> <div id="pola"> <form id="nowy" css="nowyurzyt" method="post" action="koniecrej.php" onsubmit="return funkcja();"> </form> </div> </div> </div> <?echo $cz3; ob_end_flush();?> </BODY> </HTML>