Home >Backend Development >PHP Tutorial >Website directory absolute path
<code>$smarty->assign('ROOT_PATH',ROOT_PATH); $smarty->assign('ADMIN',ADMIN_PATH); <form action="<!--{$ROOT_PATH}--><!--{$ADMIN}-->/do.php?act=login" method="post"> </code>
How should the path here be written? Because I thought I might use url rewriting in the future without using relative paths
<code>$smarty->assign('ROOT_PATH',ROOT_PATH); $smarty->assign('ADMIN',ADMIN_PATH); <form action="<!--{$ROOT_PATH}--><!--{$ADMIN}-->/do.php?act=login" method="post"> </code>
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
.