By dima942251
I have a problem with page - pddpmr.ru/test.php 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 - http://angelika-sansara.ru/test.php What could it be?
My droplet - Ubuntu 14.04 x64 with vestacp.com
Login - test Password - test
<?php
$old_ua = @ini_set('user_agent', 'glopart-subscription-2');
$response = @file("http://glopart.ru/subscription/phpform/103928?"
."&subscription_login_id=".urlencode($_COOKIE["subscription_login_id"])
."&subscription_token=".urlencode($_COOKIE["subscription_token"])
."&GRemoteAddr=".urlencode($_SERVER["REMOTE_ADDR"])
."&GUserAgent=".urlencode($_SERVER["HTTP_USER_AGENT"])
."&back=".$_SERVER["SERVER_NAME"].htmlentities(urlencode($_SERVER["REQUEST_URI"])));
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!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
According to the php documentation on file(), you won’t be able to use it on URLs if fopen wrappers are disabled. Try using file_get_contents() instead:
$response = @file_get_contents("http://glopart.ru/subscription/phpform/103928?"
...
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.