PHP Warning: ftp_put(): PORT command successful. in /mnt/drive2/cron_job/ftp.php on line 49
I got this problem. And I check the solution on the website – add the ftp_pasv() after ftp_login()
But I still got this problem. And I found out the problem in PHP. The problem is the command exceed the length. Please check your path.
PHP, Program
ftp_put, php, solve
由於看到網上很多錯誤資訊, 所以自己寫下對session的行動, 研究在於function session_set_save_handler 所得出來的結論, 如有問題, 請指教
由session_start();開始, session只會做普通variable的動作
action.php
session_start();
$_SESSION[‘user’] = ‘abc’;
$_SESSION[‘user’] = ‘ddd’;
直到讀到file完結才會真正儲存session file
所以當action.php session有修改的時候, 最後加了
session_start();
$_SESSION[‘user’] = ‘abc’;
$_SESSION[‘user’] = ‘ddd’;
header(‘Location: index.php’);
exit();
就會即時跳到index.php, 這暫時不會儲存action.php的session, 也當沒有做過東西將他放了一個黑洞(無人不知的地方),直到index.php行完, 才會返回action.php儲存action.php的session
所以當index.php讀取$_SESSION[‘user’], 只會拿回沒有被修改的$_SESSION[‘user’]
PHP, Program
header, location, session
http://www.uedcss.com/post/flash-Pop-up-layer.html
從網上找了2個方法, 解決彈出層被flash遮罩住
一:flash插入方式如下的,採用方法
1.在<object> 裡添加 <param name=”wmode” value=”transparent”>
2.在<embed> 設置 wmode=”opaque”
也可以實現
二:采用JavaScript插入flash方式如下:
var flashvars = {};
var params = {wmode:”opaque”};
swfobject.embedSWF(‘images/logo.swf’, ‘logo’, ‘179’, ’57’, “9.0.0”,”expressInstall.swf”,flashvars,params);
Flash, Javascript, Program
flash, javascript, z-index
substring some keyword
var keyword = ‘abc’;
var index = ($(“#content”).val().indexOf(keyword));
if(index != -1){
var pre = $(“#content”).val().substring(0, index);
var pos = $(“#content”).val().substring(index+keyword.length);
$(“#content”).val(pre+pos);
}
Javascript, Program
javascript, jquery, substr, substring
<?php mysql_query(“SET NAMES ‘utf8′”); ?>
由於php mysql set utf8_general_ci, 但是在table column set左latin1_swedish_ci, 就會產生
#1267 – Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation ‘like’
SELECT * FROM `table` WHERE `field` like ‘%這些%’
改成
SELECT * FROM `table` WHERE `field` like ‘%這些%’ COLLATE utf8_general_ci
Database, MYSQL, PHP, Program
COLLATE, Illegal mix of collations, mysql
由於php session 儲存在 database, 所以當有bot出現的時候, 我看到session 會儲存大量bot session, 所以要檢查user agent 是否bot. 那bot 就不會儲存session (database, file).
function isNotBot(){
$bots = array(
‘msn’ => ‘http://search.msn.com/msnbot.htm’,
‘yahoo’ => ‘http://help.yahoo.com/help/us/ysearch/slurp’,
‘WebAlta’ => ‘http://www.webalta.net/ru/about_webmaster.html’,
‘google’ => ‘http://www.google.com/bot.html’,
‘media_google’ => ‘mediapartners-google’,
‘soso’ => ‘http://help.soso.com/webspider.htm’
);
$agent = strtolower($_SERVER[‘HTTP_USER_AGENT’]);
foreach($bots as $name => $bot)
{
if(stripos($agent,$bot)!==false)
{
//echo $name;
return false;
}
}
//if( strpos( $_SERVER[‘HTTP_USER_AGENT’], “Googlebot” ) !== false )
//return false;
return true;
}
if(isNotBot())
session_start();
PHP, Program
bot, filter, php, session, user agent
列印網上資料都會有很多不相關資料在附近, 因此做法有很多
例如:
1. 是開一個page, 用來給人列印, 之後在瀏覽器按列印
2. 有時在css print set display: none, 另周邊資料不顯示
3. 用iframe顯示所需資料之後整一個button 列印 iframe page
但近來看到一些新方法, 看法都簡單所以放上來分享, 第2給自己空閒時用來溫習. 這個方法就是用js解決
function printSelection(node){
var title = ”;
var content=document.getElementById(node).innerHTML;
var pwin=window.open(”,’print_content’,’width=750,height=600,titlebar=no,location=0,toolbar=0,menubar=0,directions=0′);
pwin.document.open();
pwin.document.write(‘<html><head><title>’ + title + ‘</title><style>body table{font-size:10px}</style></head><body onload=”window.print()”>’+content+'</body></html>’);
pwin.document.close();
setTimeout(function(){pwin.close();},1000);
}
Javascript, Program
data, javascript, print
根據 http://jquery.andreaseberhard.de/pngFix/
都是利用使用AlphaImageLoader解決 IE6 對 png 圖檔的透明問題
從而找到有關資料
http://jax-work-archive.blogspot.com/2009/07/alphaimageloader-ie6-png.html
CSS :
#ContainerWrapper{
background: transparent url(/images/border_bg.png) repeat-y;
width:982px;
margin:0 auto;
/*IE6 PNG 檔透明修正設定*/
_background: transparent;
_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’/images/border_bg.png’, sizingMethod=’scale’);
}
#ContainerWrapper #Container{
/*修正 AlphaImageLoader 造成的連結失效問題*/
_position:relative;
}
HTML:
<div id=”ContainerWrapper”>
<div id=”Container”>
</div>
</div>
Javascript, Program
javascript, png