<div id="post_contenter">
{% for post in post_lists|slice:":5" %}
<div class="post_content" id="post_content">
<!---Другая информация о посте--->
</div>
{% endfor %}
</div>
{% if posts %}
<div class="post-list">
{% for post in posts %}
<div class="post_content" id="post_content">
<!---Другая информация о посте--->
</div>
{% endfor %}
</div>
{% endif %}
{% if request.user == post.author %}
<span>
<a href="{{ post.get_edit_url }}" class="post_user_edit">Редактировать</a>
</span>
{% endif %}
{% if request.user.custom_username_field == post.author %}
<span><a href="{% url 'edit_post' post.slug %}" class="post_user_edit">Редактировать</a></span>
{% endif %}
[20/Feb/2024 11:21:16] "GET /edit_post/userpublication-7/ HTTP/1.1" 302 0
[20/Feb/2024 11:21:16] "GET /userpublication-7/ HTTP/1.1" 302 0
[20/Feb/2024 11:21:16] "GET /userpublication-7/ HTTP/1.1" 302 0
[20/Feb/2024 11:21:16] "GET /userpublication-7/ HTTP/1.1" 302 0
[20/Feb/2024 11:21:16] "GET /userpublication-7/ HTTP/1.1" 302 0
[20/Feb/2024 11:21:16] "GET /userpublication-7/ HTTP/1.1" 302 0
[20/Feb/2024 11:21:16] "GET /userpublication-7/ HTTP/1.1" 302 0
<?php
require "database.php";
$_SESSION['logged_user'] = $user; // User's session
$sessionId = $_SESSION["id"];
$user = mysqli_fetch_assoc(mysqli_query($link, "SELECT * FROM users WHERE id = $sessionId"));
?>
$user = mysqli_fetch_assoc(mysqli_query($link, "SELECT * FROM users WHERE id = $sessionId"));
$link = mysqli_connect($dbhost, $username, $password, $dbname);
то фото профиля обновляется и загружается и оно отображается, но только при условии $_SESSION["id"] = 1;R::setup('mysql:host=localhost;dbname=penguin_rus',
вылезает ошибка с нулевым значением, потому что вместо $link должна быть другая переменная $user = mysqli_fetch_assoc(mysqli_query($link, "SELECT * FROM users WHERE id = $sessionId"));
дублирование прекратилось)