I have a page with links of this type:

http://sait.ru/go.php?url=aHR0cDovL3VsLnRvL2xhMmxwbWxo 

The file go.php says:

 <?php $url=isset($_REQUEST['url']) ? $_REQUEST['url'] : ''; echo base64_decode($url); ?> 

Clicking on http://sait.ru/go.php?url=aHR0cDovL3VsLnRvL2xhMmxwbWxo results in a page with plain text decoded http://ul.to/la2lpmlh .

How can I make the page open at this link?

  • one
    @ Mikhail Lobachev, If you are given an exhaustive answer, mark it as correct (click on the check mark next to the selected answer). - Bastiane

2 answers 2

It will be right to do this:

 $url = isset($_GET['url']) ? base64_decode($_GET['url']) : null; header('Location: '.$url); exit; 

And it is desirable to put it in a separate file, where only these lines will be, and then there will definitely be no errors.

UPD:
And make sure that the file is saved in UTF-8 без BOM , to be sure already.

  • Everything in the go.php file. It turns out the exact same garbage:> PHP SCRIPT ERROR! > Warning: Cannot modify header information - (output started at /home/us8963/sait.ru/www/go.php.12) in /home/us8963/sait.ru/www/go.php on line 7 What to do with it? - mixart_2
  • @ Mikhail Lobachev read the last line of my answer. - Bastiane
  • Nothing changes. The address bar remains a link in this form: sait.ru/go.php?url=aHR0cDovL3VsLnRvL2xhMmxwbWxo And the same error. - mixart_2
  • Thank you, everything was decided. ) There were extra spaces in the php file. ) - mixart_2

Instead of echo... put the header('Location: '.base64_decode($url)); .

Update

This means that in the file before the header some text is displayed, possibly spaces.

  • And so the error:> PHP SCRIPT ERROR! > Warning: Cannot modify header information - (output started at /home/us8963/sait.ru/www/go.php.12) in /home/us8963/sait.ru/www/go.php on line 7> If you need your support team. - mixart_2
  • 2
    Updated the answer. - Get