This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function () { var scroll_length = 20; var stuck_threshold = 2; var height = 4000; var url = window.location.href.split("url=")[1]; var wait = parseInt(url.split("#")[1]); var start_time = new Date().getTime() / 1000; var yo = function () { document.getElementById('ttt').contentWindow.document.getElementById('footer-links').innerHTML += "<div style='background-color:gray;width:10px;position:absolute;height:" + height + "px;top:0;left:0;'> <\/div>"; var win = document.getElementById('ttt').contentWindow; var doc = document.getElementById('ttt').contentWindow.document; var i = 0; var last = 0; while (i < height) { win.scrollTo(0, i); i += scroll_length; } alert("#take:" + ((new Date().getTime() / 1000) - start_time - wait / 1000)); }; setTimeout(yo, wait); document.body.innerHTML = ("<iframe id='ttt' src='" + url + "' width='100%' height='100%'></iframe>"); })(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//宣告 | |
var url_arr=new Array('software.sopili.net','dev.sopili.net'); | |
//讀取 | |
for(var i in url_arr){ | |
document.write(url_arr[i]+'<br>'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$counter_file='count.txt'; | |
$count=intval(file_get_contents($counter_file)); | |
$handle=fopen($counter_file,'w+'); | |
fwrite($handle,$count+1); | |
fclose($handle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$HTTP["host"] == "event.sopili.com" { | |
server.document-root = "/home/www/event/" | |
fastcgi.server = ( ".php" => | |
(( | |
"bin-path" => "/usr/local/bin/php-cgi -c /usr/local/etc/php_event.ini", | |
"socket" => "/tmp/event-php-fastcgi.socket", | |
)) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label><input name='func' type='radio' value='abc' />abc</label> | |
.... | |
<script type='text/javascript'> | |
jQuery(document).ready(function(){ | |
jQuery("input[name=func][value='abc']").attr('checked',true); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(empty($_SESSION['id'])) //必需要先登入 | |
die('Please Login First'); | |
must_referer("http://admin.tools.sopili.net"); //來源一定要是從 admin.tools.sopili.net 操作 | |
save_post($_POST['content'],$_SESSION['id']); //可以進行儲存的動作 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/<div>[\n\r.]*?<\/div>/ig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name='list'> | |
<option value=''>all</option> | |
<option value='abc'>abc</option> | |
</select> | |
<script type='text/javascript'> | |
jQuery(document).ready(function(){ | |
jQuery("select[name=list]").val("abc"); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(empty($_SESSION['id'])) //必需要先登入 | |
die('Please Login First'); | |
save_post($_POST['content'],$_SESSION['id']); //可以進行儲存的動作 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//input可以是單一字串,或是array | |
function must_referer($src){ | |
$src_arr=Array(); | |
if(empty($_SERVER['HTTP_REFERER'])) //一定要有referer url | |
exit; | |
$src_arr=(is_array($src))?$src:Array($src); | |
foreach($src_arr as $url) | |
if(strpos($_SERVER['HTTP_REFERER'],$url)===0) //一定要match到,而且是第一個字元就要match到 |