I
I
innavaj2021-01-05 14:49:19
PHP
innavaj, 2021-01-05 14:49:19

How to fix error in php redirect script?

Tell me where I made a mistake. How to fix the script. Thanks

$uri = trim(strip_tags($_SERVER['REQUEST_URI']));
$links = file('redlink.txt');
shuffle($links);
$test = $links[0];
$test2 = $test.uri;
header('HTTP/1.1 301 Moved Temporarily');
header('Location: '.$test2);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Ezhgurov, 2021-01-05
@innavaj

$test2 = trim($test) . $uri;
Unless, of course, you really want to add a random line from the redlink.txt file before $uri.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question