I
I
Ivan2018-04-05 01:11:11
PHP
Ivan, 2018-04-05 01:11:11

Is it possible to automatically log in to a paid, closed php page?

There is a service that allows you to close the content of the page, make access by login and password, the user can view the content of the page only by paying for access for a certain time .
Here is the php code that needs to be inserted at the very top of the page:

<?php
  $old_ua = @ini_set('user_agent', 'glopart-subscription-2');
  $response = @file("http://glopart.ru/subscription/phpform/184767?"
  ."&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);
?>
<?php
echo 'Дальнейший php код в который должен передаться третий параметр из url.'
?>

I need to make sure that I do not need to enter a login and password .
Those. I started a script that should perform certain functions if access to the functions is paid.
You need to log in on the fly and then execute the script if the authorization is not passed, i.e. access is not paid, display an informational message about the need to pay for access.
I plan (if it is actually possible to implement it at all) to send parameters to the url:
login, password and my_params .
Can this be arranged with the above code? If yes, what is the best way.
I planned to send a string like ~ login=admin&password=admin$my_params=123
It became interesting to me, the 3rd parameter will work after the script is authorized?
Please, give practical advice so that I can competently set a task for a freelancer.
It would be great if you could teach the script to save authorization data, for example, to the auth.cookie file, in order to pass authorization less often.
Interested in your opinion on this.
ps there is an option with js
var l = document.createElement('div');
l.id='glo_lock';
l.setAttribute('style', 'position:fixed;top:0;left:0;right:0;bottom:0;background:#FFF;z-index:999');
document.body.appendChild(l);
var WARE = '4AEDDB31DD584AABBB21090EC0D743B9';
var _glo_jsForm = "<link rel=\"stylesheet\" href=\"//fonts.googleapis.com/css?family=Lato\" type=\"text/css\"><link rel=\"stylesheet\" href=\"//glopart.ru/assets/gui-styles.ffe0655e7e14f6ef9151cbd1666009be.css\" type=\"text/css\"><link rel=\"stylesheet\" href=\"//glopart.ru/assets/subscriptionForm-styles.a2ecdba6258b179bb240a44d995d5727.css\" type=\"text/css\"><div id=\"glopart_subscription\" class=\"g-subscription\"><div class=\"g-loading\"><h1>Загрузка</h1></div><div class=\"g-intro\"><div class=\"g-col-icon\"><div class=\"g-icon\"><i class=\"fa fa-lock\"></i></div></div><div class=\"g-col-body\"><h1>Доступ к сайту</h1><p>Доступ к этой странице предоставляется на платной основе.<br>Стоимость: 1000.0 Руб</p><p>После оплаты вам на почту придет письмо с вашим логином<br>и паролем для доступа.</p><div class=\"g-buttons\"><div class=\"g-row with-gutter\"><div class=\"g-col\"><a class=\"btn g-ctrl btn-green g-go-to-form\" href=\"#\">Уже есть доступ</a></div><div class=\"g-col\"><a class=\"btn g-ctrl btn-green\" href=\"https://glopart.ru/buy/184767\">Оплатить доступ</a></div></div></div></div></div><div class=\"g-form g-hidden\"><div class=\"g-col-icon\"><div class=\"g-icon\"><i class=\"fa fa-lock\"></i></div></div><div class=\"g-col-body\"><form name=\"form\"><h1>Доступ к сайту</h1><div class=\"g-hint-error g-hidden g-error-block\"><p></p></div><div class=\"g-hint-warning g-hidden g-prolong-block\"><p>Cрок действия вашей подписки закончился</p><p><a class=\"g-link dot inherit\">Продлить</a></p></div><div class=\"g-hint-info g-hidden g-access-granted\"><h5>Доступ разрешен</h5><p>Страница перегрузится автоматически.</p></div><div class=\"g-form-controls-block\"><div class=\"g-row\"><div class=\"g-col-xs-12 g-col-md-8\"><div class=\"g-form-group\"><label>Логин</label><input class=\"g-ctrl width-max\" name=\"login\" type=\"text\"></div><div class=\"g-form-group\"><label>Пароль</label><input class=\"g-ctrl width-max\" name=\"password\" type=\"password\"></div></div></div><div class=\"g-buttons\"><div class=\"g-row with-gutter g-middle\"><div class=\"g-col\"><button class=\"g-ctrl btn-green g-submit-btn\">Получить доступ</button></div><div class=\"g-col g-hint-help\"><a class=\"g-link inherit dot\" href=\"https://glopart.ru/buy/184767\">оплатить</a> или <a class=\"g-link inherit dot\" href=\"https://glopart.ru/subscription/remind/184767\" target=\"_blank\">напомнить доступ</a></div></div></div></div></form></div></div></div>";
var m = document.getElementsByTagName('script')[0];
var s = document.createElement('script');
s.src = '//glopart.ru/assets/subscriptionForm-3f89af4c89dacedf2da5.js';
m.parentNode.insertBefore(s,m);

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2018-04-05
@xmoonlight

Interested in your opinion on this.
You have mess in your head.
You will not be able to assign a task to a freelancer in any way. (About security - I generally keep quiet ...)
The only right decision: order TK on freelance.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question