Some problem with code php. Page don't remember my authorize.

December 5, 2014 986 views

I have a problem with page -
This page have some code, that block page's content. And after login/pas i must see - Hello World (page's content), but after login i see protect form again.
I test this code on other hosting and it work perfect -
What could it be?

My droplet - Ubuntu 14.04 x64 with

Login - test
Password - test

  $old_ua = @ini_set('user_agent', 'glopart-subscription-2');
  $response = @file(""
  if ($response !== false) {
   if (count($response)>1 || $response[0] != 'true') {
    header('Content-Type: text/html; charset=utf-8');
    die(implode("", $response));
  } else die('Не удалось запросить внешний сервер');
  @ini_set('user_agent', $old_ua);

Hello world

Thanks for any help!

1 Answer

According to the php documentation on file(), you won't be able to use it on URLs if fopen wrappers are disabled. Try using filegetcontents() instead:

$response = @file_get_contents(""
Have another answer? Share your knowledge.