M
M
Maxim Ivanov2015-11-09 17:52:49
PHP
Maxim Ivanov, 2015-11-09 17:52:49

How to put a password on a json file and how to get its data after admin authorization?

Let's say we have files in the json folder:
db.json, .htaccess
.htaccess

Options All -Indexes

<FilesMatch ".(json)$">
 Order Allow,Deny
 Deny from all
 </FilesMatch>

But here's how to get data by a php script from the admin panel (provided that the administrator session is activated) to this file? Because anyone can put a php script in a folder and read the file (and this is not allowed)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2015-11-09
@omaxphp

In order not to attach "crutches" to your scripts, take the time to write scripts safely.
There are a lot of articles - well, start at least with this
habrahabr.ru/post/12067
PS.
If you didn't leave a "HOLE", then no one will be able to put a php script on your site!
Files (json, txt, js, css, html) are created so that the client part of the site (browser) has access to them. You can download and watch them.

D
Dmitry Skogorev, 2015-11-09
@EnterSandman

I mean, anyone can put php in a folder?
You invented a bicycle, and now you want to invent a lock for it.
Give json by generating another php script and check sessions there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question