Answer the question
In order to leave comments, you need to log in
How to set the path to a file when working with Open Server?
I want to load the site header. One header for multiple pages.
Header code (simplified. I know that you can write html in php)
//Верх страницы
echo'
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv=Content-Type content="text/html;charset=UTF-8">
<!-- Основной css файл -->
<link rel="stylesheet" type="text/css" href="'.$path_to_root_dir.'/main.css" /></head>
<body>';
$path_to_root_dir=__DIR__;
//Верх страницы - ну то есть код написанный выше
include_once ($path_to_root_dir.'/common/page_header.php');
$path_to_root_dir=__DIR__;
<link rel="stylesheet" type="text/css" href="D:\OpenServer\domains\my_site.ru/main.css" />
$path_to_root_dir='';
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