PHP coding summary

 1,确定URL:

// defining the URL
$url   =   ' http:// ' . $_SERVER [ ' HTTP_HOST ' ] . dirname ( $_SERVER [ ' PHP_SELF ' ]);
// check for a trailing slash.
if (( substr ( $url ,   - 1 ==   ' / ' ) OR ( substr ( $url ,   - 1 ==   ' / ' ))  {
  
$url   =   substr (url ,   0 ,   - 1 );   // chop off the slash.
}

 2,处理文件上载的表单必须的语法的三部分:

< form enctype = " multipart/form-data "  action = " script.php "  method = " post " >
< input type = " hidden "  name = " MAX_FILE_SIZE "  value = " 30000 " />
File   < input type = " file "  mame = " upload " />

 

 

 

你可能感兴趣的:(PHP coding summary)