Answer the question
In order to leave comments, you need to log in
How to assemble a new php script from strings and values in a php script and save it to disk?
<?php
if(empty($_SERVER['PHP_AUTH_USER']))
{
header('WWW-Authenticate: Basic realm="WWW-Authenticate"');
header ('HTTP/1.0 401 Unauthorized');
exit();
}
$login = md5($_SERVER['PHP_AUTH_USER']);
$parol = md5($_SERVER['PHP_AUTH_PW']);
$html = <<<_END
<?php
if (md5($_SERVER['PHP_AUTH_USER'] != $login || md5($_SERVER['PHP_AUTH_PW']) != $parol)
{
header('WWW-Authenticate: Basic realm="WWW-Authenticate"');
header ('HTTP/1.0 401 Unauthorized');
exit();
}
?>
_END;
// далее создание файла.html из $html
?>
Answer the question
In order to leave comments, you need to log in
<?php
$login='username';
$html = <<<_END
<?php
\$login='{$login}';
if (md5(\$_SERVER['PHP_AUTH_USER'] != \$login || md5(\$_SERVER['PHP_AUTH_PW']) != \$parol)
{
header('WWW-Authenticate: Basic realm="WWW-Authenticate"');
header ('HTTP/1.0 401 Unauthorized');
exit();
}
?>
_END;
?>
To insert a piece from another php file into a php file, it is enough to write:
And about <script language="php">
Every time you use this syntax, somewhere in the world a kitten is crying...
I will answer the question asked by this user, but deleted by the moderators (What is it - the ideal CMS of the future?).
Boolive is truly the ideal CMS of the future.
versatile, advanced, comfortable, lightweight. suitable for the vast majority of tasks.
The bottom line is that everything on the site has objects (a set of data + logic) that make up two hierarchies: a parent-child and a prototype object (inheritance), and all this is controlled from the admin panel.
It's a very flexible system, I played it on LAN, fell in love with it already.
It is best to join this project, it is not possible for a beginner to write an ideal CMS from scratch. Boolive has been developing for several years
boolive.ru
habrahabr.ru/company/boolive/blog/211488
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question