php表单提交怎么写?

2024-11-07 23:57:44
有1个网友回答
网友(1):

php相对路径

echo ' web-root = '.$_SERVER['DOCUMENT_ROOT'].'
';
echo ' current-file = '.__FILE__.'
';
echo ' current-dir = '.dirname(__FILE__).'
';

echo ' http-root = '.$_SERVER['HTTP_HOST'].'
';
echo ' web-position = '.$_SERVER['PHP_SELF'].'
';

$file='c:/webroot/index.php';
echo ' file-position = '.$file.'
';

$fileWebAddress='http://'.str_replace($_SERVER['DOCUMENT_ROOT'],$_SERVER['HTTP_HOST'],$file);
echo ' file-web-position = '.$fileWebAddress.'
';

?>