$_GET[] does not work

Asked

Viewed 426 times

1

I have a page .onion hosted by Freedom, which supports PHP 5, I’m trying to load the site’s home page home.html from the "Loader" index.php, in which it begins in the code:

<?php
   $get = $_GET['load'];
   if(strpos($_GET['load'],'/language/') !== false) {
     $loadurl = file_get_contents("home.html");
     echo($loadurl);
     exit;
  }

then when I go to the site, this is what appears at the beginning of the page and it is not displayed correctly:

inserir a descrição da imagem aqui

both files are in the root of the hosting directory. how to troubleshoot these messages?

2 answers

5


You need to use isset to check if get has the index.

   if( isset( $_GET['load'] ) )
   {
       if( strpos( $_GET['load'] , '/language/' ) !== false )
       {
         $loadurl = file_get_contents("home.html");
         echo($loadurl);
         exit;
      }
  }

2

Try passing the load variable as parameter in your url

index.php?load=VALOR

Browser other questions tagged

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