Is it possible to manipulate the current url with php?

Asked

Viewed 47 times

1

Oops, I want php to send a GET form when I upload the page. But I’m not getting it.

$forget = 'abc';
$url = $_SERVER['PHP_SELF'].'?get='.$forget;
header('Location:'.$url);

1 answer

0

Try this way, so you are using the PHP Curl library.

$forget = 'abc';
$url = $_SERVER['PHP_SELF'].'?get='.$forget;

// Cria o cURL
$curl = curl_init();

// Seta algumas opções
curl_setopt_array($curl, [
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_URL => $url
]);

// Envia a requisição e salva a resposta
$response = curl_exec($curl);

// Fecha a requisição e limpa a memória
curl_close($curl);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.