D
D
deafmovie2021-03-19 15:46:48
Access rights
deafmovie, 2021-03-19 15:46:48

Site in Web Forms - how to allow access only to this application?

Hello, we have created an application in WebForms that opens the site.
What should be written in the site in index.php to check that access comes from the application, so that when you enter the site from a regular browser, there is an empty page, and from the application, the site is displayed.

how to write in index.php simple if

$token = "dfakli32aedaf"

if (webforms == token) { site access} else { echo 'access denied!'}

tell me a simple real example of what webforms should send or how, and what to check in index.php on the site.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Loli E1ON, 2021-03-19
@E1ON

You can change the UserAgent to, for example, webforms , and check it in PHP:

<?php

if ($_SERVER['HTTP_USER_AGENT'] !== 'webforms') {
    die();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question