| Цитата(PARROT @ 16.3.2006, 18:23) | | Код | <center>Регистрация нового пользователя<Form Method="POST"> Имя пользователя:<br><Input Type="text" Name="login" Value=""><Br> Пароль:<Br><Input Type="password" Name="passw1" Value=""><Br> Повторите пароль:<Br><Input Type="password" Name="passw2" Value=""><Br> <Input Type="submit" name="send" Value="Add User"> <Input Type="reset" Value="Очистить"> </Form> </center> <?php if($send){
if(!ereg("^[a-z0-9]+$", $login)){ $error="Ошибка: Вы ввели недопустимое имя пользователя!<br>"; } if(!ereg("^[a-z0-9]+$", $passw1)){ $error.="Ошибка: Вы ввели недопустимый пароль!<br>"; } if($passw1!==$passw2){ $error.="Введите пароль правильно!"; }
if(!$error){ $data=file("users.txt"); foreach ($data as $us){ list($pass, $log)=split("\t", $us); if($log==$login){ $er="Этот логин занят!!!"; } } if(!$er){ $dat=fopen("users.txt", "a"); fwrite($dat, "$passw1\t$login\n"); fclose($dat); } } else {echo"$error";} } ?>
|
|
на странице:
| Код | Notice: Undefined variable: error in w:\home\webbiz.org.ru\www\partner\index.php on line 21 [ убрать подсказку | никогда больше не показывать ] [Денвер: показать возможную причину ошибки] Notice: Undefined offset: 1 in w:\home\webbiz.org.ru\www\partner\index.php on line 24
Notice: Undefined variable: er in w:\home\webbiz.org.ru\www\partner\index.php on line 30
|
но самое главное: я добавляю такой же ник а он его ещё раз добавляет, как ничего нибывало! |