update example and add new pictures

This commit is contained in:
rsgrinko committed 2021-05-07 14:49:51 +03:00
1 parent fe04b532ff
commit befa7970b9
4 files changed
+54 -5

No files matched your search

+2 -1
View File
@@ -1,7 +1,8 @@
# BasicFramework
A simple framework for building web applications
![alt text](loginform.png "Login form")
![alt text](user-example.png "Описание будет тут")
![alt text](user-example.png "Private user section")
## class DataBase
When creating a class in the constructor, you must specify the data for connecting to the database<br>
+52 -4
View File
@@ -6,14 +6,15 @@
https://it-stories.ru
*/
require_once $_SERVER['DOCUMENT_ROOT'].'/core/bootstrap.php';
echo '<div class="main">';
/*
Авторизация
*/
if($_REQUEST['act']=='login'){
if(!$User->SecurityAuthorize($_REQUEST['login'], $_REQUEST['password'])) {
echo 'login fail!<br>';
echo '<div class="error">login fail!</div>';
}
}
@@ -25,6 +26,10 @@ if($_GET['act']=='logout') {
if($User->is_user()):
$user_fields = $User->getFields();
?>
<p>Добро пожаловать, <?=$user_fields['name'];?>! <a href="example.php?act=logout">Выход</a></p>
<pre><?=print_r($user_fields, true);?></pre>
<?php
@@ -61,8 +66,8 @@ endforeach;
else:
?>
<form action="example.php" method="POST">
<input type="hidden" name="act" value="login">
<input type="text" name="login" placeholder="Enter your login"><br>
<input type="hidden" name="act" value="login" required>
<input type="text" name="login" placeholder="Enter your login" required><br>
<input type="password" name="password" placeholder="Enter your password"><br>
<input type="submit" value="Login"><br>
</form>
@@ -72,8 +77,51 @@ endif;
echo '<pre>'.session_id().'</pre>';
echo '</div>';
?>
<style>
input[type="submit"] {
width: 100%;
margin-top: 10px;
height: 40px;
border: none;
border-bottom: 1px solid black;
border-right: 1px solid black;
cursor: pointer;
}
input[type="text"], input[type="password"] {
height: 33px;
width: 100%;
margin-top: 5px;
}
.main {
width: 240px;
margin: 0 auto;
margin-top: 150px;
border: 1px solid #bdbdbd;
padding: 19px;
border-radius: 30px 0px 30px 0px;
background:white;
}
body {
background: linear-gradient(45deg, #000000, #888888);
}
table {
font-size: 12px;
}
.error {
border: 1px solid red;
background: #ffd7d7;
color: #820000;
padding: 5px;
text-align: center;
margin-bottom: 10px;
}
</style>
<?
/*
Регистрация
*/
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 111 KiB