Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
само си промени usernameif($_POST['username'] == 'demo'){echo"Не може да се регистрираш с името demo"}else{//koda ti//}
<?php
if(isset($_POST['submit']) && $_SESSION['name'] == NULL)
{
if($_POST['name'] == NULL || $_POST['pass1'] == NULL || $_POST['pass2'] == NULL || $_POST['mail'] == NULL)
{
echo '
<table class="error1-reg" width="40%" align="center">
<td class="error-reg" rowspan="4" width="5%" align="center">
<img src="images/task_error.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Този емайл е зает.</span></td>
</table>';
}
elseif($_POST['pass1'] != $_POST['pass2'])
{
echo '
<table class="error1-reg" width="40%" align="center">
<td class="error-reg" rowspan="4" width="5%" align="center">
<img src="images/task_error.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Паролите не си съвпадат.</span></td>
</table>';
}
else
{
$name = htmlspecialchars($_POST['name']);
$pass = md5($_POST['pass1']);
$mail = htmlspecialchars($_POST['mail']);
$sex = htmlspecialchars($_POST['sex']);
$cars = htmlspecialchars($_POST['cars']);
$insert = "INSERT INTO `users` (`name` , `pass` , `mail` , `sex`, `cars`, `ban`) VALUES ('$name', '$pass', '$mail', '$sex', '$cars', '0')";
$select_users = mysql_query('SELECT * FROM users WHERE mail="'.$mail.'"');
if(mysql_num_rows($select_users)==0)
{
if(mysql_query($insert))
{
echo '
<table class="active1-reg" width="36%" align="center">
<td class="active-reg" rowspan="4" width="5%" align="center">
<img src="images/task_done.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Успешно се регистрирахте.</span></td>
</table>';
}
else
{
echo '
<table class="error1-reg" width="40%" align="center">
<td class="error-reg" rowspan="4" width="5%" align="center">
<img src="images/task_error.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Регистрацията не е успешна.</span></td>
</table>';
}
}
else
{
echo '
<table class="error1-reg" width="46%" align="center">
<td class="error-reg" rowspan="4" width="5%" align="center">
<img src="images/task_error.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Има потребител с този имейл адрес.</span></td>
</table>';
}
}
}
?>
<?php
if(isset($_POST['submit']) && $_SESSION['name'] == NULL)
{
if($_POST['name'] == NULL || $_POST['pass1'] == NULL || $_POST['pass2'] == NULL || $_POST['mail'] == NULL)
{
echo '
<table class="error1-reg" width="40%" align="center">
<td class="error-reg" rowspan="4" width="5%" align="center">
<img src="images/task_error.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Този емайл е зает.</span></td>
</table>';
}
elseif($_POST['pass1'] != $_POST['pass2'])
{
echo '
<table class="error1-reg" width="40%" align="center">
<td class="error-reg" rowspan="4" width="5%" align="center">
<img src="images/task_error.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Паролите не си съвпадат.</span></td>
</table>';
}
else
{
$name = htmlspecialchars($_POST['name']);
$pass = md5($_POST['pass1']);
$mail = htmlspecialchars($_POST['mail']);
$sex = htmlspecialchars($_POST['sex']);
$cars = htmlspecialchars($_POST['cars']);
if($name=="demo")
{
echo "Забранено е използването на това име";
}
else
{
$insert = "INSERT INTO `users` (`name` , `pass` , `mail` , `sex`, `cars`, `ban`) VALUES ('$name', '$pass', '$mail', '$sex', '$cars', '0')";
$select_users = mysql_query('SELECT * FROM users WHERE mail="'.$mail.'"');
if(mysql_num_rows($select_users)==0)
{
if(mysql_query($insert))
{
echo '
<table class="active1-reg" width="36%" align="center">
<td class="active-reg" rowspan="4" width="5%" align="center">
<img src="images/task_done.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Успешно се регистрирахте.</span></td>
</table>';
}
else
{
echo '
<table class="error1-reg" width="40%" align="center">
<td class="error-reg" rowspan="4" width="5%" align="center">
<img src="images/task_error.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Регистрацията не е успешна.</span></td>
</table>';
}
}
else
{
echo '
<table class="error1-reg" width="46%" align="center">
<td class="error-reg" rowspan="4" width="5%" align="center">
<img src="images/task_error.gif" width="33" border="0" height="33">
</td>
<td width="50%" align="center"><span style="font-weight: bold;">Има потребител с този имейл адрес.</span></td>
</table>';
}
}
}
}
?>