L
L
lemonlimelike2017-07-08 18:42:36
PHP
lemonlimelike, 2017-07-08 18:42:36

After the redirect, no data is displayed?

Here is the code:

<?php
require_once "includes/config.php";
if (isset($_POST['search'])) {
$word = mysqli_real_escape_string($connection, $_POST['search']);
$result = mysqli_query($connection, "SELECT * FROM videos WHERE title LIKE '%$word%'");
header('Location: http://www.site.ru/search.php'); 
$end_result = '';
$ter = array();
while($row = mysqli_fetch_array($result)){
$ter[] = $row;
}
}
?>

Before the redirect, all the data was displayed, but when I updated the page, I licked the window, like confirm the page update ... something like that. And now the redirect works, but the data does not work, why?
those. data is not displayed*

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
ThunderCat, 2017-07-08
@lemonlimelike

It seems that you are trying to milk a cow, but are not very aware of how the process is going on, and reading is not for you. Therefore, first you try to enter the barn through the roof, then through the wall, then still go through the window. Further, the cow is standing in a stall, so at first you try to milk her by the horns, sitting on her back, then by the tail, hanging from the floor beams, now you have found where the milk is dripping and dig a hole from the neighboring stall with the horse to finally get to the bottom udder.
IT IS NOT EASIER TO READ WHAT AND HOW IT IS DONE? Or ask a milkmaid?

B
Boris Korobkov, 2017-07-08
@BorisKorobkov

This is the 4th duplicate question in a day. If you are unable to understand the answers to the previous questions, then do not spam. Get a programmer.

B
Barmunk, 2017-07-08
@Barmunk

The first time the form is submitted, if (isset($_POST['search'])), it already has output. When you do a f5 or refresh the page, the previous post is gone, so you don't see your data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question