F
F
fdroid2017-01-16 06:46:37
PHP
fdroid, 2017-01-16 06:46:37

How to make the browser remember the username / password of the user of the site?

There is a site that is not public, for personal use, as well as for their own, so authorization is configured through htaccess and htpasswd (only a dozen users, so it makes no sense to fence something more complicated). Site in PHP, web server Apache 2.2. The problem is that after entering the login / password, even if the browser asks about saving the password in the affirmative, the next time you visit the site asks for credentials again, and this does not always happen, sometimes it uses already saved data.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
ThunderCat, 2017-01-16
@ThunderCat

if it's a lot of scrap every time, set a link with a login and password:
http://user:[email protected]
issue it to each user and sleep peacefully if the security is not so critical.

D
DevMan, 2017-07-14
@Formula_1

$a1 = array_column($a1, null, 'course_id');
$sorted = array_map(function($v) use ($a1) {
  return $a1[$v];
}, array_column($a2, 'course_id'));
print_r($sorted);

ideone.com/KcKHiq

E
Evgeny Kulakov, 2017-07-14
@kulakoff

It will work, respectively, only when the lengths of the arrays are equal:

var arr1 = [
  {course_id: 50, name: "name 1"},
  {course_id: 150, name: "name 2"},
  {course_id: 100, name: "name 3"}
]
var arr2 = [
  {course_id: 150},
  {course_id: 50},
  {course_id: 100}
]

var res = arr1.map((el,idx) => {
    el.course_id = arr2[idx].course_id
    return el
  }).sort((a,b) => a.course_id-b.course_id)

console.log(res)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question