V
V
Vadim9972014-10-10 17:27:17
PHP
Vadim997, 2014-10-10 17:27:17

How to disable the display of a php page in the browser, which is located in the directory, but not disable the php file itself?

There is an authorization file login.php and a file located in the scripts/script.php directory. The form submission goes from the login.php file to the scripts/script.php file. I wanted to prevent the browser from viewing the scripts/script.php page by writing the following code in .htaccess:

<FilesMatch ".(htaccess|htpasswd|ini|php|fla|psd|log|sh)$">
 Order Allow,Deny
 Deny from all
 </FilesMatch>

How to prevent the display of the scripts/script.php file in the browser, but leave it working as a script to which form data is sent.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2014-10-10
@SilenceOfWinter

I didn’t really understand the meaning, but apparently it’s about adding php files to check ala first

<?php defined('SECRET_KEY') or die('No direct access allowed.');

Accordingly, the SECRET_KEY constant is declared in the index file. When trying to open a php file out of context, an error message is displayed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question