Answer the question
In order to leave comments, you need to log in
How to set up CNC on a self-written site in PHP?
I pass the parameter accountName=qwe AJAX to init.php:
$.ajax({
type: 'post',
url: 'init.php',
data: form_data,
success: function (result) {
console.log(result);
}
} );
the request is executed as needed, the variable is written to the database, but the page from index.php comes in the console.log response. In init.php for the test, I left only one function for writing to the database, of this type account_add($db, $name); which only returns true/false (that's what console.log should return)
.htaccess like this
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
in index.php CNCs are organized like this:
$url = $_SERVER['REQUEST_URI'];
switch ($url) {
case '/':
require_once($app_directory . '/templates/main.php');
break;
case '/accounts/':
require_once($app_directory . '/templates/accounts.php');
break;
}
Why does the page from Index.php end up in console.log?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question