簡單來說就是在自己CodeIgniter專案下加入幾個檔案
讓eclipse自動的出現提示
原文出處:http://www.web-and-development.com/codeigniter-and-eclipse-autocomplete/
2011年10月2日 星期日
Python 開發環境架設
在學習任何程式語言的第一步不外乎就是架設環境
在windows裡學習Python開發中
需要安裝python-3.2.2.msi
安裝完需要設定環境變數Path
多加D:\Python32;D:\Python32\Tools\Scripts;這兩項(視安裝目錄所變)
才讓在windows裡跑Python
還需要一套IDE(雖然有內建Python GUI但是很陽春)
在這裡我選用eclipse因為之前開發PHP也是用這套
eclipse真的是包山包海什麼都有
開發Python需要pydev套件才能在eclipse裡下run
安裝完還需要在eclipse裡的pydev裡的Interpreter -Python
設定指向python的安裝目錄的python.exe
這樣就能在eclipse下執行python了
如果需要要在apache下跑需要python就需要安裝mod_python-3.3.1模組了
在windows裡學習Python開發中
需要安裝python-3.2.2.msi
安裝完需要設定環境變數Path
多加D:\Python32;D:\Python32\Tools\Scripts;這兩項(視安裝目錄所變)
才讓在windows裡跑Python
還需要一套IDE(雖然有內建Python GUI但是很陽春)
在這裡我選用eclipse因為之前開發PHP也是用這套
eclipse真的是包山包海什麼都有
開發Python需要pydev套件才能在eclipse裡下run
安裝完還需要在eclipse裡的pydev裡的Interpreter -Python
設定指向python的安裝目錄的python.exe
這樣就能在eclipse下執行python了
如果需要要在apache下跑需要python就需要安裝mod_python-3.3.1模組了
2011年8月4日 星期四
[PHP]取得檔案的副檔名[轉載]
//假設檔名
$filename = 'mypic.gif';
// 1. 使用陣列函式 "explode/end" 方式
$ext = end(explode('.', $filename));
// 2. 使用字串函式 "strrchr" 方式
$ext = substr(strrchr($filename, '.'), 1);
// 3. 使用字串函式 "strrpos" 方式
$ext = substr($filename, strrpos($filename, '.') + 1);
// 4. 使用正規式 "preg_replace" 方式
$ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename);
// 5. 特別(從來沒用過)方式
// 參考: http://php.about.com/od/finishedphp1/qt/file_ext_PHP.htm
$exts = split("[/\\.]", $filename);
$n = count($exts)-1;
$ext = $exts[$n];
pathinfo(path,options)PATHINFO_DIRNAME:取得資料夾路徑 PATHINFO_BASENAME:取得整個檔名(主+副) PATHINFO_EXTENSION:取得副檔名 PATHINFO_FILENAME :取得主檔名pathinfo() 返回一個關聯數組包含有 path 的信息
包括以下的數組元素:[dirname] [basename] [extension][filename]2011年8月2日 星期二
[PHP]用來-轉檔-縮圖-輸出
<?php
class resize_img
{
var $image_path = '';
//holds the image path
var $sizelimit_x = 250;
//the limit of the image width
var $sizelimit_y = 250;
//the limit of the image height
var $image_resource = '';
//holds the image resource
var $keep_proportions = true;
//if true it keeps the image proportions when resized
var $resized_resource = '';
//holds the resized image resource
var $hasGD = false;
var $output = 'SAME';
//can be JPG, GIF, PNG, or SAME (same will save as old type)
function resize_img()
{
if( function_exists('gd_info') ){ $this->hasGD = true; } //---判斷GD函式是否支援
}
function resize_image( $image_path )
{
if( $this->hasGD === false ){ return false; }
//沒有GD支援
list($img_width, $img_height, $img_type, $img_attr) = @getimagesize( $image_path );
//這是會得到的圖像的寬度,高度和格式
if( ( $img_width != 0 ) || ( $img_width != 0 ) )
//確保它是正確裝入
{
switch( $img_type )
{
case 1:
//GIF
$this->image_resource = @imagecreatefromgif( $image_path );
if( $this->output == 'SAME' ){ $this->output = 'GIF'; }
break;
case 2:
//JPG
$this->image_resource = @imagecreatefromjpeg( $image_path );
if( $this->output == 'SAME' ){ $this->output = 'JPG'; }
break;
case 3:
//PNG
$this->image_resource = @imagecreatefrompng( $image_path );
if( $this->output == 'SAME' ){ $this->output = 'PNG'; }
}
if( $this->image_resource === '' ){ return false; }
//它無法加載圖像
}
else{ return false; }
//發生無法預期的錯誤
if( $this->keep_proportions === true )
{
if( ($img_width-$this->sizelimit_x) > ($img_height-$this->sizelimit_y) )
{
//如果IMG寬度 大於規定的大小限制,我們的寬度將做縮減
$scalex = ( $this->sizelimit_x / $img_width );
$scaley = $scalex;
}
else
{
//如果IMG高度 大於規定的大小限制,我們的高度將做縮減
$scalex = ( $this->sizelimit_y / $img_height );
$scaley = $scalex;
}
}
else
{
$scalex = ( $this->sizelimit_x / $img_width );
$scaley = ( $this->sizelimit_y / $img_height );
//只是使圖像適合圖像的大小限制
if( $scalex > 1 ){ $scalex = 1; }
if( $scaley > 1 ){ $scaley = 1; }
//圖像小於限制所以不做變更
}
$new_width = $img_width * $scalex;//計算新的寬
$new_height = $img_height * $scaley;//計算新的高
$this->resized_resource = @imagecreatetruecolor( $new_width, $new_height );
//創建一個圖像資源,用寬度和高度的大小限制(或新的調整比例)
if( function_exists( 'imageantialias' )){ @imageantialias( $this->resized_resource, true ); }
//有助於在質量的圖像被調整判斷是否有此函式
@imagecopyresampled( $this->resized_resource, $this->image_resource, 0, 0, 0, 0, $new_width, $new_height, $img_width, $img_height );
//調整張圖片上調整資源
@imagedestroy( $this->image_resource );
//清空舊的圖像資源
return true;
}
//判斷輸出為什麼格式
function save_resizedimage( $path, $name )
{
switch( strtoupper($this->output) )
{
case 'GIF':
//GIF
@imagegif( $this->resized_resource, $path . $name . '.gif' );
break;
case 'JPG':
//JPG
@imagejpeg( $this->resized_resource, $path . $name . '.jpg' );
break;
case 'PNG':
//PNG
@imagepng( $this->resized_resource, $path . $name . '.png' );
}
}
//--此函式用來在頁面顯示圖片
function output_resizedimage()
{
$the_time = time();
header('Last-Modified: ' . date( 'D, d M Y H:i:s', $the_time ) . ' GMT');
header('Cache-Control: public');
switch( strtoupper($this->output) )
{
case 'GIF':
//GIF
header('Content-type: image/gif');
@imagegif( $this->resized_resource );
break;
case 'JPG':
//JPG
header('Content-type: image/jpg');
@imagejpeg( $this->resized_resource );
break;
case 'PNG':
//PNG
header('Content-type: image/png');
@imagepng( $this->resized_resource );
}
}
function destroy_resizedimage()
{
@imagedestroy( $this->resized_resource );
@imagedestroy( $this->image_resource );
}
}
?>
/*範例-----可以用來-轉檔-縮圖-輸出
$imgresize = new resize_img();
$imgresize->sizelimit_x = 100;
$imgresize->sizelimit_y = 100;
$imgresize->keep_proportions = true;
$imgresize->output = 'GIF';
$filename = uniqid().rand(1000,9999);
if( $imgresize->resize_image( $_FILES['Filedata']['tmp_name'] ) === false )
{
echo 'ERROR!';
}
else
{
$imgresize->save_resizedimage( 'D:/www/test/thumbnails/', $filename );
}
$imgresize->destroy_resizedimage();
*/
class resize_img
{
var $image_path = '';
//holds the image path
var $sizelimit_x = 250;
//the limit of the image width
var $sizelimit_y = 250;
//the limit of the image height
var $image_resource = '';
//holds the image resource
var $keep_proportions = true;
//if true it keeps the image proportions when resized
var $resized_resource = '';
//holds the resized image resource
var $hasGD = false;
var $output = 'SAME';
//can be JPG, GIF, PNG, or SAME (same will save as old type)
function resize_img()
{
if( function_exists('gd_info') ){ $this->hasGD = true; } //---判斷GD函式是否支援
}
function resize_image( $image_path )
{
if( $this->hasGD === false ){ return false; }
//沒有GD支援
list($img_width, $img_height, $img_type, $img_attr) = @getimagesize( $image_path );
//這是會得到的圖像的寬度,高度和格式
if( ( $img_width != 0 ) || ( $img_width != 0 ) )
//確保它是正確裝入
{
switch( $img_type )
{
case 1:
//GIF
$this->image_resource = @imagecreatefromgif( $image_path );
if( $this->output == 'SAME' ){ $this->output = 'GIF'; }
break;
case 2:
//JPG
$this->image_resource = @imagecreatefromjpeg( $image_path );
if( $this->output == 'SAME' ){ $this->output = 'JPG'; }
break;
case 3:
//PNG
$this->image_resource = @imagecreatefrompng( $image_path );
if( $this->output == 'SAME' ){ $this->output = 'PNG'; }
}
if( $this->image_resource === '' ){ return false; }
//它無法加載圖像
}
else{ return false; }
//發生無法預期的錯誤
if( $this->keep_proportions === true )
{
if( ($img_width-$this->sizelimit_x) > ($img_height-$this->sizelimit_y) )
{
//如果IMG寬度 大於規定的大小限制,我們的寬度將做縮減
$scalex = ( $this->sizelimit_x / $img_width );
$scaley = $scalex;
}
else
{
//如果IMG高度 大於規定的大小限制,我們的高度將做縮減
$scalex = ( $this->sizelimit_y / $img_height );
$scaley = $scalex;
}
}
else
{
$scalex = ( $this->sizelimit_x / $img_width );
$scaley = ( $this->sizelimit_y / $img_height );
//只是使圖像適合圖像的大小限制
if( $scalex > 1 ){ $scalex = 1; }
if( $scaley > 1 ){ $scaley = 1; }
//圖像小於限制所以不做變更
}
$new_width = $img_width * $scalex;//計算新的寬
$new_height = $img_height * $scaley;//計算新的高
$this->resized_resource = @imagecreatetruecolor( $new_width, $new_height );
//創建一個圖像資源,用寬度和高度的大小限制(或新的調整比例)
if( function_exists( 'imageantialias' )){ @imageantialias( $this->resized_resource, true ); }
//有助於在質量的圖像被調整判斷是否有此函式
@imagecopyresampled( $this->resized_resource, $this->image_resource, 0, 0, 0, 0, $new_width, $new_height, $img_width, $img_height );
//調整張圖片上調整資源
@imagedestroy( $this->image_resource );
//清空舊的圖像資源
return true;
}
//判斷輸出為什麼格式
function save_resizedimage( $path, $name )
{
switch( strtoupper($this->output) )
{
case 'GIF':
//GIF
@imagegif( $this->resized_resource, $path . $name . '.gif' );
break;
case 'JPG':
//JPG
@imagejpeg( $this->resized_resource, $path . $name . '.jpg' );
break;
case 'PNG':
//PNG
@imagepng( $this->resized_resource, $path . $name . '.png' );
}
}
//--此函式用來在頁面顯示圖片
function output_resizedimage()
{
$the_time = time();
header('Last-Modified: ' . date( 'D, d M Y H:i:s', $the_time ) . ' GMT');
header('Cache-Control: public');
switch( strtoupper($this->output) )
{
case 'GIF':
//GIF
header('Content-type: image/gif');
@imagegif( $this->resized_resource );
break;
case 'JPG':
//JPG
header('Content-type: image/jpg');
@imagejpeg( $this->resized_resource );
break;
case 'PNG':
//PNG
header('Content-type: image/png');
@imagepng( $this->resized_resource );
}
}
function destroy_resizedimage()
{
@imagedestroy( $this->resized_resource );
@imagedestroy( $this->image_resource );
}
}
?>
/*範例-----可以用來-轉檔-縮圖-輸出
$imgresize = new resize_img();
$imgresize->sizelimit_x = 100;
$imgresize->sizelimit_y = 100;
$imgresize->keep_proportions = true;
$imgresize->output = 'GIF';
$filename = uniqid().rand(1000,9999);
if( $imgresize->resize_image( $_FILES['Filedata']['tmp_name'] ) === false )
{
echo 'ERROR!';
}
else
{
$imgresize->save_resizedimage( 'D:/www/test/thumbnails/', $filename );
}
$imgresize->destroy_resizedimage();
*/
[PHP]頁面連接函式
//一面多少個資料
$results_per_page = 50;
//多少個頁面
$num_pages = ceil(count($friend['data'])/$results_per_page);
//當前頁面
$cur_page = isset($_GET['page']) ? $_GET['page'] : 1;
//定位該頁面的第一筆資料
$skip = (($cur_page - 1 )*$results_per_page);
$friends=array();
//一次只拿50個資料
$friends = array_slice($friend['data'],$skip,$results_per_page);
//------------------------------------------------------------
function generate_page_links($cur_page, $num_pages) {
$page_links = '';
$before = $cur_page - 4;
$after = $cur_page + 4;
($before < 1 ? $before=1:'');
($after > $num_pages ? $after = $num_pages:'');
// If this page is not the first page, generate the "previous" link
if ($cur_page > 1) {
$page_links .= '<a href="' . $_SERVER['PHP_SELF'] . '?page=' . ($cur_page - 1) . '"><-</a> ';
}
else {
$page_links .= '<- ';
}
// Loop through the pages generating the page number links
for ($before; $before <= $after ;$before++) {
if ($cur_page == $before) {
$page_links .= ' ' . $before;
}
else {
$page_links .= ' <a href="' . $_SERVER['PHP_SELF'] . '?page=' . $before . '"> ' . $before . '</a>';
}
}
// If this page is not the last page, generate the "next" link
if ($cur_page < $after) {
$page_links .= ' <a href="' . $_SERVER['PHP_SELF'] . '?page=' . ($cur_page + 1) . '">-></a>';
}
else {
$page_links .= ' ->';
}
return $page_links;
}
$results_per_page = 50;
//多少個頁面
$num_pages = ceil(count($friend['data'])/$results_per_page);
//當前頁面
$cur_page = isset($_GET['page']) ? $_GET['page'] : 1;
//定位該頁面的第一筆資料
$skip = (($cur_page - 1 )*$results_per_page);
$friends=array();
//一次只拿50個資料
$friends = array_slice($friend['data'],$skip,$results_per_page);
//------------------------------------------------------------
function generate_page_links($cur_page, $num_pages) {
$page_links = '';
$before = $cur_page - 4;
$after = $cur_page + 4;
($before < 1 ? $before=1:'');
($after > $num_pages ? $after = $num_pages:'');
// If this page is not the first page, generate the "previous" link
if ($cur_page > 1) {
$page_links .= '<a href="' . $_SERVER['PHP_SELF'] . '?page=' . ($cur_page - 1) . '"><-</a> ';
}
else {
$page_links .= '<- ';
}
// Loop through the pages generating the page number links
for ($before; $before <= $after ;$before++) {
if ($cur_page == $before) {
$page_links .= ' ' . $before;
}
else {
$page_links .= ' <a href="' . $_SERVER['PHP_SELF'] . '?page=' . $before . '"> ' . $before . '</a>';
}
}
// If this page is not the last page, generate the "next" link
if ($cur_page < $after) {
$page_links .= ' <a href="' . $_SERVER['PHP_SELF'] . '?page=' . ($cur_page + 1) . '">-></a>';
}
else {
$page_links .= ' ->';
}
return $page_links;
}
2011年7月31日 星期日
[PHP]過濾XXS函式
<?php
function sacarXss($val){
$val = preg_replace('/([\x00-\x08][\x0b-\x0c][\x0e-\x20])/', '', $val);
$search = 'abcdefghijklmnopqrstuvwxyz';
$search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$search .= '1234567890!@#$%^&*()';
$search .= '~`";:?+/={}[]-_|\'\\';
for ($i = 0; $i < strlen($search); $i++) {
$val = preg_replace('/(&#[x|X]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;
$val = preg_replace('/(�{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;
}
$ra1 = Array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');
$ra2 = Array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');
$ra = array_merge($ra1, $ra2);
$found = true;
while ($found == true) {
$val_before = $val;
for ($i = 0; $i < sizeof($ra); $i++) {
$pattern = '/';
for ($j = 0; $j < strlen($ra[$i]); $j++) {
if ($j > 0) {
$pattern .= '(';
$pattern .= '(&#[x|X]0{0,8}([9][a][b]);?)?';
$pattern .= '|(�{0,8}([9][10][13]);?)?';
$pattern .= ')?';
}
$pattern .= $ra[$i][$j];
}
$pattern .= '/i';
$replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2);
$val = preg_replace($pattern, $replacement, $val);
if ($val_before == $val) {
$found = false;
}
}
}
return $val;
}
?>
function sacarXss($val){
$val = preg_replace('/([\x00-\x08][\x0b-\x0c][\x0e-\x20])/', '', $val);
$search = 'abcdefghijklmnopqrstuvwxyz';
$search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$search .= '1234567890!@#$%^&*()';
$search .= '~`";:?+/={}[]-_|\'\\';
for ($i = 0; $i < strlen($search); $i++) {
$val = preg_replace('/(&#[x|X]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ;
$val = preg_replace('/(�{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ;
}
$ra1 = Array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');
$ra2 = Array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');
$ra = array_merge($ra1, $ra2);
$found = true;
while ($found == true) {
$val_before = $val;
for ($i = 0; $i < sizeof($ra); $i++) {
$pattern = '/';
for ($j = 0; $j < strlen($ra[$i]); $j++) {
if ($j > 0) {
$pattern .= '(';
$pattern .= '(&#[x|X]0{0,8}([9][a][b]);?)?';
$pattern .= '|(�{0,8}([9][10][13]);?)?';
$pattern .= ')?';
}
$pattern .= $ra[$i][$j];
}
$pattern .= '/i';
$replacement = substr($ra[$i], 0, 2).'<x>'.substr($ra[$i], 2);
$val = preg_replace($pattern, $replacement, $val);
if ($val_before == $val) {
$found = false;
}
}
}
return $val;
}
?>
[PHP]表單驗證的正則表達式
function is_email($str){
//檢驗email
return preg_match("/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/", $str);
}
function is_url($str){
//檢驗網址
return preg_match("/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"])
*$/", $str);
}
function is_zip($str){
//檢驗郵編
return preg_match("/^[1-9]\d{5}$/", $str);
}
function is_idcard($str){
//檢驗身份證
return preg_match("/^\d{15}(\d{2}[A-Za-z0-9])?$/", $str);
}
function is_chinese($str){
檢驗是否是中文
return ereg("^[".chr(0xa1)."-".chr(0xff)."]+$",$str);
}
function is_english($str){
//檢驗是否是英文
return preg_match("/^[A-Za-z]+$/", $str);
}
function is_mobile($str){
//檢驗是否是手機
return preg_match("/^((\(\d{3}\))|(\d{3}\-))?13\d{9}$/", $str);
}
//檢驗email
return preg_match("/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/", $str);
}
function is_url($str){
//檢驗網址
return preg_match("/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"])
*$/", $str);
}
function is_zip($str){
//檢驗郵編
return preg_match("/^[1-9]\d{5}$/", $str);
}
function is_idcard($str){
//檢驗身份證
return preg_match("/^\d{15}(\d{2}[A-Za-z0-9])?$/", $str);
}
function is_chinese($str){
檢驗是否是中文
return ereg("^[".chr(0xa1)."-".chr(0xff)."]+$",$str);
}
function is_english($str){
//檢驗是否是英文
return preg_match("/^[A-Za-z]+$/", $str);
}
function is_mobile($str){
//檢驗是否是手機
return preg_match("/^((\(\d{3}\))|(\d{3}\-))?13\d{9}$/", $str);
}
2011年7月26日 星期二
在IE的iframe跨域丟失Session PHP JSP APACHE
最近在寫PHP時
發現用IE在跨IFRAME時
Session常常丟失
查了老半了
後來才發現是Platform for Privacy Preferences Project specification
在搞怪
在firefox和google下似乎不會出現
google的到的辦法是
在php寫入
<?php header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR
BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
?>
就可以了
或是在apache的服務器下的寫入
<VirtualHost>
Header set P3P 'CP="CURa ADMa DEVa PSAo PSDo OUR
BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'
</VirtualHost>
不過不是很建議寫入apache並不是每個人都有這個寫入權
jsp的可以這樣寫
<%
response.setHeader("P3P","CP=CAO PSA OUR");
%>
發現用IE在跨IFRAME時
Session常常丟失
查了老半了
後來才發現是Platform for Privacy Preferences Project specification
在搞怪
在firefox和google下似乎不會出現
google的到的辦法是
在php寫入
<?php header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR
BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
?>
就可以了
或是在apache的服務器下的寫入
<VirtualHost>
Header set P3P 'CP="CURa ADMa DEVa PSAo PSDo OUR
BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'
</VirtualHost>
不過不是很建議寫入apache並不是每個人都有這個寫入權
jsp的可以這樣寫
<%
response.setHeader("P3P","CP=CAO PSA OUR");
%>
[PHP]move_uploaded_file中文檔名上傳
windows 系統中的中文檔名仍是以Big5為主
move_uploaded_file($_files[$'file_name']['tmp_name'], iconv("UTF-8","Big5",$new_tmp.$new_name))
is_file() && filesize()兩個函氏不支援中文檔名
move_uploaded_file($_files[$'file_name']['tmp_name'], iconv("UTF-8","Big5",$new_tmp.$new_name))
is_file() && filesize()兩個函氏不支援中文檔名
[PHP] $_SERVER 用法教學
$_SERVER['PHP_SELF']
#目前正在執行腳本的檔案名稱,與 document root 相關。
$_SERVER['argv']
#傳遞給該腳本的參數。
$_SERVER['argc']
#包含傳遞給程式的命令行參數的個數(如果執行在命令行模式)。
$_SERVER['GATEWAY_INTERFACE']
#伺服器使用的 CGI 規範的版本。例如,「CGI/1.1」。
$_SERVER['SERVER_NAME']
#目前執行腳本所在伺服器主機的名稱。
$_SERVER['SERVER_SOFTWARE']
#伺服器標識的字串,在回應請求時的頭部中給出。
$_SERVER['SERVER_PROTOCOL']
#請求頁面時通訊協定的名稱和版本。例如,「HTTP/1.0」。
$_SERVER['REQUEST_METHOD']
#瀏覽頁面時的請求方法。例如:「GET」、「HEAD」,「POST」,「PUT」。
$_SERVER['QUERY_STRING']
#查詢(query)的字串。
$_SERVER['DOCUMENT_ROOT']
#目前執行腳本所在的文件根目錄。在伺服器配置檔案中定義。
$_SERVER['HTTP_ACCEPT']
#目前請求的 Accept: 頭部的內容。
$_SERVER['HTTP_ACCEPT_CHARSET']
#目前請求的 Accept-Charset: 頭部的內容。例如:「iso-8859-1,*,utf-8」。
$_SERVER['HTTP_ACCEPT_ENCODING']
#目前請求的 Accept-Encoding: 頭部的內容。例如:「gzip」。
$_SERVER['HTTP_ACCEPT_LANGUAGE']
#目前請求的 Accept-Language: 頭部的內容。例如:「en」。
$_SERVER['HTTP_CONNECTION']
#目前請求的 Connection: 頭部的內容。例如:「Keep-Alive」。
$_SERVER['HTTP_HOST']
#目前請求的 Host: 頭部的內容。
$_SERVER['HTTP_REFERER']
#連結到目前頁面的前一頁面的 URL 網址。
$_SERVER['HTTP_USER_AGENT']
#目前請求的 User_Agent: 頭部的內容。
$_SERVER['REMOTE_ADDR']
#正在瀏覽目前頁面使用者的 IP 位址。
$_SERVER['REMOTE_HOST']
#正在瀏覽目前頁面使用者的主機名稱。
$_SERVER['REMOTE_PORT']
#用戶連接到伺服器時所使用的連接埠。
$_SERVER['SCRIPT_FILENAME']
#目前執行腳本的絕對路徑名稱。
$_SERVER['SERVER_ADMIN']
#管理員資訊
$_SERVER['SERVER_PORT']
#伺服器所使用的連接埠
$_SERVER['SERVER_SIGNATURE']
#包含伺服器版本和虛擬主機名稱的字串。
$_SERVER['PATH_TRANSLATED']
#目前腳本所在檔案系統(不是文件根目錄)的基本路徑。
$_SERVER['SCRIPT_NAME']
#包含目前腳本的路徑。這在頁面需要指向自己時非常有用。
$_SERVER['REQUEST_URI']
#瀏覽此頁面所需的 URI。例如,「/index.html」。
$_SERVER['PHP_AUTH_USER']
#當 PHP 執行在 Apache 模組方式下,並且正在使用 HTTP 認證功能,這個變數便是使用者輸入的使用者名稱。
$_SERVER['PHP_AUTH_PW']
#當 PHP 執行在 Apache 模組方式下,並且正在使用 HTTP 認證功能,這個變數便是使用者輸入的使用者密碼。
$_SERVER['AUTH_TYPE']
#當 PHP 執行在 Apache 模組方式下,並且正在使用 HTTP 認證功能,這個變數便是認證的類型。
#目前正在執行腳本的檔案名稱,與 document root 相關。
$_SERVER['argv']
#傳遞給該腳本的參數。
$_SERVER['argc']
#包含傳遞給程式的命令行參數的個數(如果執行在命令行模式)。
$_SERVER['GATEWAY_INTERFACE']
#伺服器使用的 CGI 規範的版本。例如,「CGI/1.1」。
$_SERVER['SERVER_NAME']
#目前執行腳本所在伺服器主機的名稱。
$_SERVER['SERVER_SOFTWARE']
#伺服器標識的字串,在回應請求時的頭部中給出。
$_SERVER['SERVER_PROTOCOL']
#請求頁面時通訊協定的名稱和版本。例如,「HTTP/1.0」。
$_SERVER['REQUEST_METHOD']
#瀏覽頁面時的請求方法。例如:「GET」、「HEAD」,「POST」,「PUT」。
$_SERVER['QUERY_STRING']
#查詢(query)的字串。
$_SERVER['DOCUMENT_ROOT']
#目前執行腳本所在的文件根目錄。在伺服器配置檔案中定義。
$_SERVER['HTTP_ACCEPT']
#目前請求的 Accept: 頭部的內容。
$_SERVER['HTTP_ACCEPT_CHARSET']
#目前請求的 Accept-Charset: 頭部的內容。例如:「iso-8859-1,*,utf-8」。
$_SERVER['HTTP_ACCEPT_ENCODING']
#目前請求的 Accept-Encoding: 頭部的內容。例如:「gzip」。
$_SERVER['HTTP_ACCEPT_LANGUAGE']
#目前請求的 Accept-Language: 頭部的內容。例如:「en」。
$_SERVER['HTTP_CONNECTION']
#目前請求的 Connection: 頭部的內容。例如:「Keep-Alive」。
$_SERVER['HTTP_HOST']
#目前請求的 Host: 頭部的內容。
$_SERVER['HTTP_REFERER']
#連結到目前頁面的前一頁面的 URL 網址。
$_SERVER['HTTP_USER_AGENT']
#目前請求的 User_Agent: 頭部的內容。
$_SERVER['REMOTE_ADDR']
#正在瀏覽目前頁面使用者的 IP 位址。
$_SERVER['REMOTE_HOST']
#正在瀏覽目前頁面使用者的主機名稱。
$_SERVER['REMOTE_PORT']
#用戶連接到伺服器時所使用的連接埠。
$_SERVER['SCRIPT_FILENAME']
#目前執行腳本的絕對路徑名稱。
$_SERVER['SERVER_ADMIN']
#管理員資訊
$_SERVER['SERVER_PORT']
#伺服器所使用的連接埠
$_SERVER['SERVER_SIGNATURE']
#包含伺服器版本和虛擬主機名稱的字串。
$_SERVER['PATH_TRANSLATED']
#目前腳本所在檔案系統(不是文件根目錄)的基本路徑。
$_SERVER['SCRIPT_NAME']
#包含目前腳本的路徑。這在頁面需要指向自己時非常有用。
$_SERVER['REQUEST_URI']
#瀏覽此頁面所需的 URI。例如,「/index.html」。
$_SERVER['PHP_AUTH_USER']
#當 PHP 執行在 Apache 模組方式下,並且正在使用 HTTP 認證功能,這個變數便是使用者輸入的使用者名稱。
$_SERVER['PHP_AUTH_PW']
#當 PHP 執行在 Apache 模組方式下,並且正在使用 HTTP 認證功能,這個變數便是使用者輸入的使用者密碼。
$_SERVER['AUTH_TYPE']
#當 PHP 執行在 Apache 模組方式下,並且正在使用 HTTP 認證功能,這個變數便是認證的類型。
SMTP錯誤、DNS錯誤代碼表
一些常見的SMTP錯誤、DNS錯誤代碼
表(一) SMTP 代碼
代碼 釋義
421 <domain> Service not available, closing transmission channel 括號內的主機無法提供正常服務,關閉傳送管道,郵件將滯留在主機上
450 Requested mail action not taken: mailbox unavailable 所要求的郵件動作無法執行:郵件信箱無法提供服務,郵件將滯留在主機上
451 Requested action aborted: local error in processing 要求動作中斷:本地端錯誤
452 Requested action not taken: insufficient system storage 要求動作無法執行:系統空間不足
550 Requested action not taken: mailbox unavailable 所要求動作無法執行:信箱不存在,郵件將退回給寄件者
551 User not local; please try <forward-path> 郵件服務器知道使用者不屬於本地端,將嘗試括號內的轉送路徑
552 Requested mail action aborted: exceeded storage allocation 所要求的動作中斷:超出所分配的儲存空間,郵件將退回給寄件者
553 Requested action not taken: mailbox name not allowed 所要求的動作未執行:信箱不允許該動作執行
554 Transaction failed 傳送失敗
表(二) DSN 錯誤代碼
注意事項:第一個字符為 4 或 5
4.X.X 代表暫時錯誤,郵件服務器將稍後再試
5.X.X 代表郵件傳送失敗
類別 代碼 釋義
X.1.X 表示郵件地址(Address)問題 X.1.0 Other address status 其它郵件地址問題
X.1.1 Bad destination mailbox address 收件地址信箱錯誤
X.1.2 Bad destination system address 收件地址系統錯誤
X.1.3 Bad destination mailbox address syntax 收件地址信箱句法錯誤
X.1.4 Destination mailbox address ambiguous 收件地址信箱不清
X .1.5 Destination mailbox address valid 收件地址信箱無效
X.1.6 Mailbox has moved 信箱已移除
X.1.7 Bad sender's mailbox address syntax 寄件者信箱句法錯誤
X.1.8 Bad sender's system address 寄件者係統錯誤
X.2.X 表示收件者信箱(Mailbox)問題 X.2.0 Other or undefined mailbox status 其它或未定義的收件者信箱問題
X.2.1 Mailbox disabled, not accepting messages 信箱無法運作,無法接收信件
X.2.2 Mailbox full 信箱已滿
X.2.3 Message length exceeds administrative limit. 郵件長度超出管理者限制
X.2.4 Mailing list expansion problem 此信箱屬於特定郵件群組,但群組無法開展
X.3.X 表示目的地郵件系統(Mail System)問題 X.3.0 Other or undefined mail system status 其它或未定義的郵件系統問題
X.3.1 Mail system full 郵件系統儲存空間已滿
X.3.2 System not accepting network messages 主機無法接收信件,可能暫時關機、維修等
X.3.3 System not capable of selected features 指定的郵件特徵無法為收件主機所接收
X.3.4 Message too big for system 郵件大小超出郵件系統限制
X.3.5 System incorrectly configured 系統設定錯誤,無法接收郵件
X.4.X 表示郵件傳送系統網絡與路由(Network and Routing)問題 X.4.0 Other or undefined network or routing status 其它或未定義的網絡與路郵設定問題
X.4.1 No answer from host 主機無響應
X.4.2 Bad connection 聯機錯誤
X.4.3 Directory server failure 網絡系統無法轉送郵件,例如無法聯機到DNS服務器
X.4.4 Unable to route 郵件系統所需的路由信息不足,無法決定傳送路由
X.4.5 Network congestion 網絡壅塞
X.4.6 Routing loop detected 郵件因錯誤的路由設定,多次遶行而無法傳送
X.4.7 Delivery time expired 郵件滯留主機過久
X.5.X
表示郵件傳送協議問題 (Mail Delivery Protocol)問題,可能是寄件方、收信方或是傳送郵件系統的 問題 X.5.0 Other or undefined protocol status 其它或未定義的通訊協議問題
X.5.1 Invalid command 命令無效
X.5.2 Syntax error 郵件傳送協議的句法錯誤
X.5.3 Too many recipients 太多收件者
X.5.4 Invalid command arguments 命令敘述錯誤
X.5.5 Wrong protocol version 錯誤的通訊協議版本
X.6.X
表示郵件內容或媒介(Message Content or Media)的問題,收件者與寄件者雙方必需支持同樣的內容 類別(Content Type) X.6.0 Other or undefined media error 其它或未定義的媒介問題
X.6.1 Media not supported 傳送協議或轉送郵件的系統不支持該媒介
X.6.2 Conversion required and prohibited 郵件內容在傳送之前必需經過轉換動作,但該動作不被允許
X.6.3 Conversion required but not supported 郵件內容在轉送之前須經過轉換動作,但無法執行
X.6.4 Conversion with loss performed 郵件傳送成功,但部份內容因無法轉換而遺失
X.6.5 Conversion failed 轉換動作失敗
X.7.X 表示安全或郵件監控規則(Security or Policy) 的問題 X.7.0 Other or undefined security status 其它安全或郵件監控規則問題
X.7.1 Delivery not authorized, message refused 寄件者無授權傳送信件
X.7.2 Mailing list expansion prohibited 寄件者無授權寄信予該郵件群組
X.7.3 Security conversion required but not possible 郵件安全協定
X.7.4 Security features not supported 郵件含有安全特徵如認證措施,但不為傳送協議所接受
X.7.5 Cryptographic failure 經授權得以認證或解密該郵件的系統無法完成該動作,因所需信息不完全
X.7.6 Cryptographic algorithm not supported 經授權得以認證或解密該郵件的系統無法完成該動作,因算法不支持
X.7.7 Message integrity failure 經授權得以認證該郵件的系統無法完成該動作,因郵件已損毀
*******************************************************************************
發送郵件常見出錯代碼
按照下列「Q」代表問題,「A」代表解答。
Q:the server says:550 relaying mail to <> is not allowed
Q:The server says:550 <>... relaying denied
Q:the server says:550 5.7.1 relaying not permitted:
A:使用某些Smtp服務器時,限制了收件人的地址,只能換一個Smtp服務器。
Q:The server says:550 <>:local user only
Q:The server says:550 <>:Invalid User
Q:The server says:550 Invalid recipient
A:使用163.net,163.com,yeah.net和netease.com之類的Smtp服務器時,只能用自身的信箱發信,所以要在Outlook Express的「帳戶屬性」中的「個人信息」裡面填寫正確的郵件地址。
Q:the server says:551 delivery not allowed to non-local recipient
Q:The server says:553 Relay restriction.
Q:The server says:553 From <>, message blocked.
Q:The server says:553 sorry,you are not allow to use this SMTP to relay your eami
Q:The server says:553 sorry, that domain isn't in my list of allowed rcpthosts
A:使用21cn.com,china.com,371.net,sina.com等大多數信箱的smtp服務器時,只能用自身的信箱發信,所以要在 Outlook Express的「帳戶屬性」中的「個人信息」裡面填寫正確的郵件地址。
Q:The server says:505 client was not authenticated
Q:The server says:553 authentication is required to send mail as <>
A:使用263.net和sohu.com的Smtp服務器時,不但要用自身的郵箱發信,而且要加入身份驗證,所以即要在「個人信息」中填寫正確郵箱地址,又要選中「SMTP服務器需要認證」。
Q:The server says:535 Error:authenticatin failed
Q:The server says:535 Authentication unsuccessful
Q:The server says:452 Insufficient system storage
A:在使用Esmtp認證的過程中出錯,檢查一下Esmtp設置,多試幾次。
Q:The server says:553 <>...domain name required
Q:The server says:550 Unable to relay for ...
A:多出現在用Wingate代理服務器發送郵件時。雖然在Wingate中「POP3 郵箱帳號」要使用「用戶名#POP3地址」的格式,但在「帳戶屬性」中的「個人信息」中還是要填寫一般的格式。
Q:The server says:553 mailbox name not allowed
A:收件人郵箱地址不允許,需檢查收件人地址是否正確。
Q:the server says:553 sorry, your envelop sender is in my badmailfrom list
A:服務器限制了收件人的地址,只能換一個smtp服務器發信。
Q:the server says:554 Transaction failed
Q:The server says:451 Requested action aborted,errno=28
A:傳輸失敗,檢查網絡問題。
Q:the server says:503 error:needmail command
Q:The server says:503 need mail before RCPT.
Q:The server says:503 Bad sequence of commands
A:消息命令順序出錯,一般出現在其他錯誤之後,先檢查之前出現的錯誤提示。
Q:The Server says:501 syntax.helo hostname
Q:The server says:501 Invalid domain name
Q:The server says:502 unimplemented command
Q:the server says:503 5.0.0 polite people say HELO first
Q:The server says:533 relay restriction
Q:The server says:544 <>:Recipient address rejected: Relay access denied
A:傳輸中的語法錯誤,原因不明。
Outlook Express錯誤代碼表
錯誤碼 一般意義
0x800C0131 可能是 Folders.dbx 文件屬性錯誤或損壞
0x800C013E 可能是 Folders.dbx 文件屬性錯誤或損壞
0x800CCC00 身份驗證(Authentication)未載入
0x800CCC01 認證(Certificate)內容錯誤
0x800CCC02 認證日期錯誤
0x800CCC03 使用者已連線
0x800CCC05 未連接到服務器
0x800CCC0A 郵件下載未完成
0x800CCC0B 服務器忙碌中
0x800CCC0D 找不到主機(檢查你的SMTP服務器是不是設錯,亦可能是對方Server 的問題,例如 Mail Server 沒有開機、對方的DNS 服務器死掉了等等)
0x800CCC0E 聯機到服務器失敗,無法與主機建立聯機。可能對方主機正在維護中、或是網絡聯機品質不好、服務器關機、郵件服務器尚未啟動等等,等一段時間再試。
如果你的防毒軟體有類似「電子郵件防護」這類的功能,建議先關閉「電子郵件防護」再做收發郵件的測試,從經驗中得知,有時會因為防毒軟體的「電子郵件防護」的干擾,會產生不能收發郵件的情形。
0x800CCC0F 服務器結束連線(對方服務器負荷過重、網路傳輸堵塞易造成此現象,可以試著增加你連線逾時的等候時間試試看,或是換一連線品質較佳的 ISP)
0x800CCC10 服務器無法辨認此郵件位址
0x800CCC11 服務器無法辨認的 Mailing list
0x800CCC12 無法傳送 Winsock request
0x800CCC13 無法接收 Winsock reply
0x800CCC14 無法起始 Winsock
0x800CCC15 無法開啟 Windows Socket
0x800CCC16 無法辨認使用者帳號,使用者帳號錯誤
0x800CCC17 使用者中斷操作
0x800CCC18 登入失敗 (例如:不需要安全密碼認證登入,但卻設了安全密碼認證登入)
0x800CCC19 連接服務器超時
0x800CCC1A 無法以 SSL 建立連線
Winsock 錯誤
0x800CCC40 Network subsystem 無法使用
0x800CCC41 Windows Sockets 不支持此應用程序
0x800CCC43 Bad address.
0x800CCC44 Windows Sockets 無法載入
0x800CCC45 Operation now in progress..
SMTP 錯誤
0x800CCC60 不合法的回應
0x800CCC61 不明的錯誤代碼
0x800CCC62 收到語法錯誤
0x800CCC63 語法參數不正確
0x800CCC64 指令不完整
0x800CCC65 不正確的指令序列
0x800CCC66 指令不完整
0x800CCC67 沒有這個指令
0x800CCC68 郵件信箱被鎖住或忙碌中
0x800CCC69 找不到郵件信箱
0x800CCC6A 處理要求錯誤
0x800CCC6B 郵件信箱不在此服務器上
0x800CCC6C 已無空間儲存郵件
0x800CCC6D 已超過限制的儲存容量上限
0x800CCC6E 不合法的郵件信箱名稱
0x800CCC6F Transaction error,出現這訊息,可能是服務器不接受你的郵件,請跟你的 ISP 聯絡。
0x800CCC78 不明的寄件者,或郵件回覆(reply-to)地址不正確,或需要身份認證(Yahoo 郵件需要 SMTP 認證)。
0x800CCC79 收件者被服務器拒絕 (Relay Denied:最常發生於 Outlook Express 的 SMTP 設定不正確,請使用提供你連線服務的ISP公司之SMTP服務 器來寄信,)
0x800CCC7A 沒有指定寄件者
0x800CCC7B 沒有指定收件者
POP3 錯誤
0x800CCC90 登入郵件服務器發生錯誤,檢查一下你是不是有使用該服務器的權限。或者:不需要安全密碼認證登入,但卻設了安全密碼認證登入
0x800CCC91 使用者名稱錯誤或找不到此使用者
0x800CCC92 帳號、密碼錯誤
0x800CCC93 無法解釋回應
0x800CCC94 需要指令
0x800CCC95 服務器上已無郵件
0x800CCC96 沒有郵件標記為要下載
0x800CCC97 Message ID 超出範圍
NNTP 錯誤
0x800CCCA0 新聞服務器回應錯誤,可能你沒有擁有可使用該服務器的權限。
0x800CCCA1 讀取新聞群組失敗
0x800CCCA2 要求服務器郵件清單失敗
0x800CCCA3 無法顯示清單
0x800CCCA4 無法開啟群組
0x800CCCA5 服務器無此群組
0x800CCCA6 郵件不在服務器上
0x800CCCA7 找不到件標題
0x800CCCA8 找不到郵件本文
0x800CCCA9 無法發佈到服務器上
0x800CCCAA 無法開啟下封郵件
0x800CCCAB 無法顯示日期
0x800CCCAC 無法顯示標題
0x800CCCAD 無法顯示 MIME 標題
0x800CCCAE 使用者名稱或密碼不正確
RAS 錯誤
0x800CCCC2 未安裝撥號網路
0x800CCCC3 找不到撥號網路
0x800CCCC4 撥號網路錯誤
0x800CCCC5 Connectoid 壞或遺失
0x800CCCC6 取得撥號設定時錯誤
IMAP 錯誤
0x800CCCD1 登入失敗
0x800CCCD2 Message tagged
0x800CCCD3 Invalid response to request.
0x800CCCD4 語法錯誤
0x800CCCD5 不是 IMAP 服務器
0x800CCCD6 Buffer 已超過上限
0x800CCCD7 Recovery error
0x800CCCD8 資料不完整
0x800CCCD9 連接被拒
0x800CCCDA 不明的回應
0x800CCCDB User ID 已更改
0x800CCCDC User ID 指令失敗
0x800CCCDD Unexpected disconnect
0x800CCCDE Invalid server state
0x800CCCDF 無法認證用戶端
郵件掃瞄錯誤
0x8004210a
(或0x800ccc19) 安裝了殺毒軟件,並打開了「掃瞄收到的電子郵件」和「掃瞄發送的電子郵件」
表(一) SMTP 代碼
代碼 釋義
421 <domain> Service not available, closing transmission channel 括號內的主機無法提供正常服務,關閉傳送管道,郵件將滯留在主機上
450 Requested mail action not taken: mailbox unavailable 所要求的郵件動作無法執行:郵件信箱無法提供服務,郵件將滯留在主機上
451 Requested action aborted: local error in processing 要求動作中斷:本地端錯誤
452 Requested action not taken: insufficient system storage 要求動作無法執行:系統空間不足
550 Requested action not taken: mailbox unavailable 所要求動作無法執行:信箱不存在,郵件將退回給寄件者
551 User not local; please try <forward-path> 郵件服務器知道使用者不屬於本地端,將嘗試括號內的轉送路徑
552 Requested mail action aborted: exceeded storage allocation 所要求的動作中斷:超出所分配的儲存空間,郵件將退回給寄件者
553 Requested action not taken: mailbox name not allowed 所要求的動作未執行:信箱不允許該動作執行
554 Transaction failed 傳送失敗
表(二) DSN 錯誤代碼
注意事項:第一個字符為 4 或 5
4.X.X 代表暫時錯誤,郵件服務器將稍後再試
5.X.X 代表郵件傳送失敗
類別 代碼 釋義
X.1.X 表示郵件地址(Address)問題 X.1.0 Other address status 其它郵件地址問題
X.1.1 Bad destination mailbox address 收件地址信箱錯誤
X.1.2 Bad destination system address 收件地址系統錯誤
X.1.3 Bad destination mailbox address syntax 收件地址信箱句法錯誤
X.1.4 Destination mailbox address ambiguous 收件地址信箱不清
X .1.5 Destination mailbox address valid 收件地址信箱無效
X.1.6 Mailbox has moved 信箱已移除
X.1.7 Bad sender's mailbox address syntax 寄件者信箱句法錯誤
X.1.8 Bad sender's system address 寄件者係統錯誤
X.2.X 表示收件者信箱(Mailbox)問題 X.2.0 Other or undefined mailbox status 其它或未定義的收件者信箱問題
X.2.1 Mailbox disabled, not accepting messages 信箱無法運作,無法接收信件
X.2.2 Mailbox full 信箱已滿
X.2.3 Message length exceeds administrative limit. 郵件長度超出管理者限制
X.2.4 Mailing list expansion problem 此信箱屬於特定郵件群組,但群組無法開展
X.3.X 表示目的地郵件系統(Mail System)問題 X.3.0 Other or undefined mail system status 其它或未定義的郵件系統問題
X.3.1 Mail system full 郵件系統儲存空間已滿
X.3.2 System not accepting network messages 主機無法接收信件,可能暫時關機、維修等
X.3.3 System not capable of selected features 指定的郵件特徵無法為收件主機所接收
X.3.4 Message too big for system 郵件大小超出郵件系統限制
X.3.5 System incorrectly configured 系統設定錯誤,無法接收郵件
X.4.X 表示郵件傳送系統網絡與路由(Network and Routing)問題 X.4.0 Other or undefined network or routing status 其它或未定義的網絡與路郵設定問題
X.4.1 No answer from host 主機無響應
X.4.2 Bad connection 聯機錯誤
X.4.3 Directory server failure 網絡系統無法轉送郵件,例如無法聯機到DNS服務器
X.4.4 Unable to route 郵件系統所需的路由信息不足,無法決定傳送路由
X.4.5 Network congestion 網絡壅塞
X.4.6 Routing loop detected 郵件因錯誤的路由設定,多次遶行而無法傳送
X.4.7 Delivery time expired 郵件滯留主機過久
X.5.X
表示郵件傳送協議問題 (Mail Delivery Protocol)問題,可能是寄件方、收信方或是傳送郵件系統的 問題 X.5.0 Other or undefined protocol status 其它或未定義的通訊協議問題
X.5.1 Invalid command 命令無效
X.5.2 Syntax error 郵件傳送協議的句法錯誤
X.5.3 Too many recipients 太多收件者
X.5.4 Invalid command arguments 命令敘述錯誤
X.5.5 Wrong protocol version 錯誤的通訊協議版本
X.6.X
表示郵件內容或媒介(Message Content or Media)的問題,收件者與寄件者雙方必需支持同樣的內容 類別(Content Type) X.6.0 Other or undefined media error 其它或未定義的媒介問題
X.6.1 Media not supported 傳送協議或轉送郵件的系統不支持該媒介
X.6.2 Conversion required and prohibited 郵件內容在傳送之前必需經過轉換動作,但該動作不被允許
X.6.3 Conversion required but not supported 郵件內容在轉送之前須經過轉換動作,但無法執行
X.6.4 Conversion with loss performed 郵件傳送成功,但部份內容因無法轉換而遺失
X.6.5 Conversion failed 轉換動作失敗
X.7.X 表示安全或郵件監控規則(Security or Policy) 的問題 X.7.0 Other or undefined security status 其它安全或郵件監控規則問題
X.7.1 Delivery not authorized, message refused 寄件者無授權傳送信件
X.7.2 Mailing list expansion prohibited 寄件者無授權寄信予該郵件群組
X.7.3 Security conversion required but not possible 郵件安全協定
X.7.4 Security features not supported 郵件含有安全特徵如認證措施,但不為傳送協議所接受
X.7.5 Cryptographic failure 經授權得以認證或解密該郵件的系統無法完成該動作,因所需信息不完全
X.7.6 Cryptographic algorithm not supported 經授權得以認證或解密該郵件的系統無法完成該動作,因算法不支持
X.7.7 Message integrity failure 經授權得以認證該郵件的系統無法完成該動作,因郵件已損毀
*******************************************************************************
發送郵件常見出錯代碼
按照下列「Q」代表問題,「A」代表解答。
Q:the server says:550 relaying mail to <> is not allowed
Q:The server says:550 <>... relaying denied
Q:the server says:550 5.7.1 relaying not permitted:
A:使用某些Smtp服務器時,限制了收件人的地址,只能換一個Smtp服務器。
Q:The server says:550 <>:local user only
Q:The server says:550 <>:Invalid User
Q:The server says:550 Invalid recipient
A:使用163.net,163.com,yeah.net和netease.com之類的Smtp服務器時,只能用自身的信箱發信,所以要在Outlook Express的「帳戶屬性」中的「個人信息」裡面填寫正確的郵件地址。
Q:the server says:551 delivery not allowed to non-local recipient
Q:The server says:553 Relay restriction.
Q:The server says:553 From <>, message blocked.
Q:The server says:553 sorry,you are not allow to use this SMTP to relay your eami
Q:The server says:553 sorry, that domain isn't in my list of allowed rcpthosts
A:使用21cn.com,china.com,371.net,sina.com等大多數信箱的smtp服務器時,只能用自身的信箱發信,所以要在 Outlook Express的「帳戶屬性」中的「個人信息」裡面填寫正確的郵件地址。
Q:The server says:505 client was not authenticated
Q:The server says:553 authentication is required to send mail as <>
A:使用263.net和sohu.com的Smtp服務器時,不但要用自身的郵箱發信,而且要加入身份驗證,所以即要在「個人信息」中填寫正確郵箱地址,又要選中「SMTP服務器需要認證」。
Q:The server says:535 Error:authenticatin failed
Q:The server says:535 Authentication unsuccessful
Q:The server says:452 Insufficient system storage
A:在使用Esmtp認證的過程中出錯,檢查一下Esmtp設置,多試幾次。
Q:The server says:553 <>...domain name required
Q:The server says:550 Unable to relay for ...
A:多出現在用Wingate代理服務器發送郵件時。雖然在Wingate中「POP3 郵箱帳號」要使用「用戶名#POP3地址」的格式,但在「帳戶屬性」中的「個人信息」中還是要填寫一般的格式。
Q:The server says:553 mailbox name not allowed
A:收件人郵箱地址不允許,需檢查收件人地址是否正確。
Q:the server says:553 sorry, your envelop sender is in my badmailfrom list
A:服務器限制了收件人的地址,只能換一個smtp服務器發信。
Q:the server says:554 Transaction failed
Q:The server says:451 Requested action aborted,errno=28
A:傳輸失敗,檢查網絡問題。
Q:the server says:503 error:needmail command
Q:The server says:503 need mail before RCPT.
Q:The server says:503 Bad sequence of commands
A:消息命令順序出錯,一般出現在其他錯誤之後,先檢查之前出現的錯誤提示。
Q:The Server says:501 syntax.helo hostname
Q:The server says:501 Invalid domain name
Q:The server says:502 unimplemented command
Q:the server says:503 5.0.0 polite people say HELO first
Q:The server says:533 relay restriction
Q:The server says:544 <>:Recipient address rejected: Relay access denied
A:傳輸中的語法錯誤,原因不明。
Outlook Express錯誤代碼表
錯誤碼 一般意義
0x800C0131 可能是 Folders.dbx 文件屬性錯誤或損壞
0x800C013E 可能是 Folders.dbx 文件屬性錯誤或損壞
0x800CCC00 身份驗證(Authentication)未載入
0x800CCC01 認證(Certificate)內容錯誤
0x800CCC02 認證日期錯誤
0x800CCC03 使用者已連線
0x800CCC05 未連接到服務器
0x800CCC0A 郵件下載未完成
0x800CCC0B 服務器忙碌中
0x800CCC0D 找不到主機(檢查你的SMTP服務器是不是設錯,亦可能是對方Server 的問題,例如 Mail Server 沒有開機、對方的DNS 服務器死掉了等等)
0x800CCC0E 聯機到服務器失敗,無法與主機建立聯機。可能對方主機正在維護中、或是網絡聯機品質不好、服務器關機、郵件服務器尚未啟動等等,等一段時間再試。
如果你的防毒軟體有類似「電子郵件防護」這類的功能,建議先關閉「電子郵件防護」再做收發郵件的測試,從經驗中得知,有時會因為防毒軟體的「電子郵件防護」的干擾,會產生不能收發郵件的情形。
0x800CCC0F 服務器結束連線(對方服務器負荷過重、網路傳輸堵塞易造成此現象,可以試著增加你連線逾時的等候時間試試看,或是換一連線品質較佳的 ISP)
0x800CCC10 服務器無法辨認此郵件位址
0x800CCC11 服務器無法辨認的 Mailing list
0x800CCC12 無法傳送 Winsock request
0x800CCC13 無法接收 Winsock reply
0x800CCC14 無法起始 Winsock
0x800CCC15 無法開啟 Windows Socket
0x800CCC16 無法辨認使用者帳號,使用者帳號錯誤
0x800CCC17 使用者中斷操作
0x800CCC18 登入失敗 (例如:不需要安全密碼認證登入,但卻設了安全密碼認證登入)
0x800CCC19 連接服務器超時
0x800CCC1A 無法以 SSL 建立連線
Winsock 錯誤
0x800CCC40 Network subsystem 無法使用
0x800CCC41 Windows Sockets 不支持此應用程序
0x800CCC43 Bad address.
0x800CCC44 Windows Sockets 無法載入
0x800CCC45 Operation now in progress..
SMTP 錯誤
0x800CCC60 不合法的回應
0x800CCC61 不明的錯誤代碼
0x800CCC62 收到語法錯誤
0x800CCC63 語法參數不正確
0x800CCC64 指令不完整
0x800CCC65 不正確的指令序列
0x800CCC66 指令不完整
0x800CCC67 沒有這個指令
0x800CCC68 郵件信箱被鎖住或忙碌中
0x800CCC69 找不到郵件信箱
0x800CCC6A 處理要求錯誤
0x800CCC6B 郵件信箱不在此服務器上
0x800CCC6C 已無空間儲存郵件
0x800CCC6D 已超過限制的儲存容量上限
0x800CCC6E 不合法的郵件信箱名稱
0x800CCC6F Transaction error,出現這訊息,可能是服務器不接受你的郵件,請跟你的 ISP 聯絡。
0x800CCC78 不明的寄件者,或郵件回覆(reply-to)地址不正確,或需要身份認證(Yahoo 郵件需要 SMTP 認證)。
0x800CCC79 收件者被服務器拒絕 (Relay Denied:最常發生於 Outlook Express 的 SMTP 設定不正確,請使用提供你連線服務的ISP公司之SMTP服務 器來寄信,)
0x800CCC7A 沒有指定寄件者
0x800CCC7B 沒有指定收件者
POP3 錯誤
0x800CCC90 登入郵件服務器發生錯誤,檢查一下你是不是有使用該服務器的權限。或者:不需要安全密碼認證登入,但卻設了安全密碼認證登入
0x800CCC91 使用者名稱錯誤或找不到此使用者
0x800CCC92 帳號、密碼錯誤
0x800CCC93 無法解釋回應
0x800CCC94 需要指令
0x800CCC95 服務器上已無郵件
0x800CCC96 沒有郵件標記為要下載
0x800CCC97 Message ID 超出範圍
NNTP 錯誤
0x800CCCA0 新聞服務器回應錯誤,可能你沒有擁有可使用該服務器的權限。
0x800CCCA1 讀取新聞群組失敗
0x800CCCA2 要求服務器郵件清單失敗
0x800CCCA3 無法顯示清單
0x800CCCA4 無法開啟群組
0x800CCCA5 服務器無此群組
0x800CCCA6 郵件不在服務器上
0x800CCCA7 找不到件標題
0x800CCCA8 找不到郵件本文
0x800CCCA9 無法發佈到服務器上
0x800CCCAA 無法開啟下封郵件
0x800CCCAB 無法顯示日期
0x800CCCAC 無法顯示標題
0x800CCCAD 無法顯示 MIME 標題
0x800CCCAE 使用者名稱或密碼不正確
RAS 錯誤
0x800CCCC2 未安裝撥號網路
0x800CCCC3 找不到撥號網路
0x800CCCC4 撥號網路錯誤
0x800CCCC5 Connectoid 壞或遺失
0x800CCCC6 取得撥號設定時錯誤
IMAP 錯誤
0x800CCCD1 登入失敗
0x800CCCD2 Message tagged
0x800CCCD3 Invalid response to request.
0x800CCCD4 語法錯誤
0x800CCCD5 不是 IMAP 服務器
0x800CCCD6 Buffer 已超過上限
0x800CCCD7 Recovery error
0x800CCCD8 資料不完整
0x800CCCD9 連接被拒
0x800CCCDA 不明的回應
0x800CCCDB User ID 已更改
0x800CCCDC User ID 指令失敗
0x800CCCDD Unexpected disconnect
0x800CCCDE Invalid server state
0x800CCCDF 無法認證用戶端
郵件掃瞄錯誤
0x8004210a
(或0x800ccc19) 安裝了殺毒軟件,並打開了「掃瞄收到的電子郵件」和「掃瞄發送的電子郵件」
2011年7月22日 星期五
2011年6月16日 星期四
2011年6月15日 星期三
2011年6月12日 星期日
2011年6月9日 星期四
訂閱:
文章 (Atom)