Mam skrypt na rejestracje i działa idealnie! Tylko jeśli rejestruje jakaś osobe to po wysłaniu rekordu, nie moge się i tak zalogować ponieważ nie ma wpisanego w kolumne acces >root<. Chciałbym żebyśćie mi pomogli w naprawieniu tego, o to skrypt:
><? require_once('config.php'); $l = usun($_POST['login']); }else{ $l = FALSE; $message .= '<font color="red">Proszę podać imie</font><br />'; } if ( eregi ("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+.[a-z]{2,4}$", stripslashes(trim($_POST['email'])))){ $e = usun($_POST['email']); }else{ $e = FALSE; $message .= '<font color="red">Proszę podać email</font><br />'; } if($_POST['pass'] == $_POST['pass2']){ $p = usun($_POST['pass']); }else{ $message .= '<font color="red">Podane hasła różnią się od siebie</font><br />'; } }else{ $message .= '<font color="red">Prosze podać hasło</font><br />'; } if ( $l && $e && $p ){ $query = "SELECT user_id FROM user WHERE username='$l'"; // sprawdzanie czy takie konto istnienie //dodajemy uzytkownika do bazy $query2 = "INSERT INTO user (username, email, haslo, data_rejstacji) VALUES ('$l', '$e', PASSWORD('$p'), NOW())"; if ($result2){ //jezeli nie wystapily zadne bledy }else{ echo 'Ze względu na wystąpienie błędu systemowego rejestracja nie była możliwa. Przepr
aszamy za wszelkie niedogodnościi.<br />'; } }else{ $message .= '<font color="red">Konto o podanym nicku juz istnieje</font><br />'; } }else{ $message .= '<font color="red">Spróbuj ponownie</font><br />'; } } ?> <html> <head> <title>Rejstracja</title> <script type="text/javascript"> <!-- // function regulamin() { if(document.getElementById('reg').checked == true ) { document.getElementById('dalej').disabled=false; } else { document.getElementById('dalej').disabled=true; } } // ]]> --> </script> </head> <body> <table align="left" border="0"> <tr> <td align="right" class="uni_01">login:</td> </td> </tr> <tr> <td align="right" class="uni_01">email:</td> </td> </tr> <tr> <td align="right" class="uni_01">hasło:</td> <td><input name="pass" type="password" size="25"><small>*minimalna długosc hasła do 4 znaki</small> </td> </tr> <tr> <td align="right" class="uni_01">powtórz hasło::</td> <td><input name="pass2" type="password" size="25"> </td> </tr> <tr> <td align="right" class="uni_01"> </td> <td> <b>Oświadczam, że zapoznałem się z regulaminem i zgadzam się na warunki tam zami
eszczone</b> <input type="checkbox" id="reg" onClick="regulamin()" /> </td> </tr> <tr> <td align="right" class="uni_01"> </td> <td> <input style="font-weight: bold;" type="submit" name="submit" value="loguj" id="dalej" disabled="disabled"> </td> </tr> </table> </form>
Podsumowanie:
Proszę żeby ktoś pokazał gdzie wstawić coś by do zarejestrowanego nowego użytkownika dopisywało root w kolumnie acces.!
Zgóry dzięki!