Home > Backend Development > PHP Tutorial > Website directory absolute path

Website directory absolute path

WBOY
Release: 2016-08-04 09:19:15
Original
1535 people have browsed it

<code>$smarty->assign('ROOT_PATH',ROOT_PATH);
$smarty->assign('ADMIN',ADMIN_PATH);

<form action="<!--{$ROOT_PATH}--><!--{$ADMIN}-->/do.php?act=login" method="post">

</code>
Copy after login
Copy after login

Website directory absolute path

Website directory absolute path

How should the path here be written? Because I thought I might use url rewriting in the future without using relative paths

Reply content:

<code>$smarty->assign('ROOT_PATH',ROOT_PATH);
$smarty->assign('ADMIN',ADMIN_PATH);

<form action="<!--{$ROOT_PATH}--><!--{$ADMIN}-->/do.php?act=login" method="post">

</code>
Copy after login
Copy after login

Website directory absolute path

Website directory absolute path

How should the path here be written? Because I thought that I might use url rewriting in the future without using relative paths

This is the www root directory which is a physical path and must be changed to the path for http access
For example: ./admin/do.php?act=login

The root directory of the webpage URL is based on the root directory of the current site, so files outside this directory cannot be accessed in the browser, so you cannot directly use the absolute path of a file like D: as the URL.
If You have configured a domain name, and the root directory of your website is D:/phpStudy/www/blog1, then the URL is: (domain name)/admin/do.php?act=login.
If you have not configured a domain name, The root directory of your website is D:/phpStudy/www, then the URL is: localhost/blog1/admin/do.php?act=login.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template