<?php
header('Content-type: text/html; charset=utf-8');
// The following variables values must reflect your installation needs.
$aspell_prog = '"C:\Program Files\Aspell\bin\aspell.exe"'; // by FredCK (for Windows)
//$aspell_prog = 'aspell'; // by FredCK (for Linux)
$lang = 'en_US';
$aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; // by FredCK
$tempfiledir = "./";
$spellercss = '../spellerStyle.css'; // by FredCK
$word_win_src = '../wordWindow.js'; // by FredCK
$textinputs = $_POST['textinputs']; # array
$input_separator = "A";
# set the JavaScript variable to the submitted text.
# textinputs is an array, each element corresponding to the (url-encoded)
# value of the text control submitted for spell-checking
function print_textinputs_var() {
global $textinputs;
foreach( $textinputs as $key=>$val ) {
# $val = str_replace( "'", "%27", $val );
echo "textinputs[$key] = decodeURIComponent(\"" . $val . "\");\n";
}
}
# make declarations for the text input index
function print_textindex_decl( $text_input_idx ) {
echo "words[$text_input_idx] = [];\n";
echo "suggs[$text_input_idx] = [];\n";
}
# set an element of the JavaScript 'words' array to a misspelled word
function print_words_elem( $word, $index, $text_input_idx ) {
echo "words[$text_input_idx][$index] = '" . escape_quote( $word ) . "';\n";
}
# set an element of the JavaScript 'suggs' array to a list of suggestions
function print_suggs_elem( $suggs, $index, $text_input_idx ) {
echo "suggs[$text_input_idx][$index] = [";
foreach( $suggs as $key=>$val ) {
if( $val ) {
echo "'" . escape_quote( $val ) . "'";
if ( $key+1 < count( $suggs )) {
echo ", ";
}
}
}
echo "];\n";
}
# escape single quote
function escape_quote( $str ) {
return preg_replace ( "/'/", "\\'", $str );
}
# handle a server-side error.
function error_handler( $err ) {
echo "error = '" . preg_replace( "/['\\\\]/", "\\\\$0", $err ) . "';\n";
}
## get the list of misspelled words. Put the results in the javascript words array
## for each misspelled word, get suggestions and put in the javascript suggs array
function print_checker_results() {
global $aspell_prog;
global $aspell_opts;
global $tempfiledir;
global $textinputs;
global $input_separator;
$aspell_err = "";
# create temp file
$tempfile = tempnam( $tempfiledir, 'aspell_data_' );
# open temp file, add the submitted text.
if( $fh = fopen( $tempfile, 'w' )) {
for( $i = 0; $i < count( $textinputs ); $i++ ) {
$text = urldecode( $textinputs[$i] );
// Strip all tags for the text. (by FredCK - #339 / #681)
$text = preg_replace( "/<[^>]+>/", " ", $text ) ;
$lines = explode( "\n", $text );
fwrite ( $fh, "%\n" ); # exit terse mode
fwrite ( $fh, "^$input_separator\n" );
fwrite ( $fh, "!\n" ); # enter terse mode
foreach( $lines as $key=>$value ) {
# use carat on each line to escape possible aspell commands
fwrite( $fh, "^$value\n" );
}
}
fclose( $fh );
# exec aspell command - redirect STDERR to STDOUT
$cmd = "$aspell_prog $aspell_opts < $tempfile 2>&1";
if( $aspellret = shell_exec( $cmd )) {
$linesout = explode( "\n", $aspellret );
$index = 0;
$text_input_index = -1;
# parse each line of aspell return
foreach( $linesout as $key=>$val ) {
$chardesc = substr( $val, 0, 1 );
# if '&', then not in dictionary but has suggestions
# if '#', then not in dictionary and no suggestions
# if '*', then it is a delimiter between text inputs
# if '@' then version info
if( $chardesc == '&' || $chardesc == '#' ) {
$line = explode( " ", $val, 5 );
print_words_elem( $line[1], $index, $text_input_index );
if( isset( $line[4] )) {
$suggs = explode( ", ", $line[4] );
} else {
$suggs = array();
}
print_suggs_elem( $suggs, $index, $text_input_index );
$index++;
} elseif( $chardesc == '*' ) {
$text_input_index++;
print_textindex_decl( $text_input_index );
$index = 0;
} elseif( $chardesc != '@' && $chardesc != "" ) {
# assume this is error output
$aspell_err .= $val;
}
}
if( $aspell_err ) {
$aspell_err = "Error executing `$cmd`\\n$aspell_err";
error_handler( $aspell_err );
}
} else {
error_handler( "System error: Aspell program execution failed (`$cmd`)" );
}
} else {
error_handler( "System error: Could not open file '$tempfile' for writing" );
}
# close temp file, delete file
unlink( $tempfile );
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="<?php echo $spellercss ?>" />
<script language="javascript" src="<?php echo $word_win_src ?>"></script>
<script language="javascript">
var suggs = new Array();
var words = new Array();
var textinputs = new Array();
var error;
<?php
print_textinputs_var();
print_checker_results();
?>
var wordWindowObj = new wordWindow();
wordWindowObj.originalSpellings = words;
wordWindowObj.suggestions = suggs;
wordWindowObj.textInputs = textinputs;
function init_spell() {
// check if any error occured during server-side processing
if( error ) {
alert( error );
} else {
// call the init_spell() function in the parent frameset
if (parent.frames.length) {
parent.init_spell( wordWindowObj );
} else {
alert('This page was loaded outside of a frameset. It might not display properly');
}
}
}
</script>
</head>
<!-- <body onLoad="init_spell();"> by FredCK -->
<body onLoad="init_spell();" bgcolor="#ffffff">
<script type="text/javascript">
wordWindowObj.writeBody();
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
ASP实例开发源码-良精OA办公系统 asp版.zip
共2080个文件
gif:1409个
png:177个
asp:174个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 186 浏览量
2022-11-17
10:12:31
上传
评论
收藏 4.08MB ZIP 举报
温馨提示
ASP实例开发源码—良精OA办公系统 asp版.zip ASP实例开发源码—良精OA办公系统 asp版.zip ASP实例开发源码—良精OA办公系统 asp版.zip
资源推荐
资源详情
资源评论
收起资源包目录
ASP实例开发源码-良精OA办公系统 asp版.zip (2080个子文件)
WebIM.asp 60KB
Lj_Mainbox.asp 48KB
Lj_Left_B.asp 47KB
Lj_Diary_ListMore.asp 44KB
Lj_Diary_New.asp 44KB
Lj_Left.asp 43KB
Lj_User.asp 31KB
Lj_Sys.asp 29KB
x_kehu.asp 27KB
Lj_Hr_Renshiview.asp 27KB
x_kehu.asp 27KB
x_yewu.asp 26KB
x_kucun.asp 25KB
Lj_KaoqingOverTimelist.asp 24KB
Lj_Jihua_New.asp 24KB
Lj_Notic_New.asp 22KB
Lj_Diary_Search.asp 22KB
Lj_Function.asp 21KB
Lj_KaoqingCchuli.asp 21KB
x_user.asp 21KB
Lj_Richeng_New.asp 20KB
Lj_Sms_New.asp 19KB
Lj_KaoqingXlist.asp 19KB
Lj_KaoqingOutlist.asp 19KB
Lj_KaoqingTravellist.asp 19KB
Lj_News_New.asp 18KB
LjOA_company.asp 18KB
x_upan.asp 18KB
LJ_KQ_EDIT.ASP 17KB
x_mail.asp 15KB
Lj_Login.asp 15KB
allsession.asp 15KB
Lj_Md5.asp 15KB
Ljnntup.asp 15KB
Lj_Diary_Left.asp 13KB
Lj_KaoQing.asp 12KB
Md5.asp 11KB
c_mone.asp 11KB
c_wai_chuli.asp 11KB
UpPicFile.asp 10KB
Lj_UpFile.asp 10KB
Lj_Diary_Right.asp 10KB
class_upload.asp 10KB
Lj_Cls_ShowoPage.asp 10KB
Lj_KaoqingSave.asp 10KB
Lj_Bumen.asp 9KB
Lj_SendUpFile.asp 9KB
Lj_Hr_Renshi.asp 9KB
ClsUp.asp 9KB
x_home.asp 9KB
c_kehu.asp 9KB
c_mone.asp 9KB
Lj_KaoqingXchuli.asp 9KB
Lj_DownFileEdit.asp 8KB
Lj_KaoqingAuditlist.asp 8KB
c_kehu.asp 8KB
Lj_c_kehu.asp 8KB
Lj_DownFile.asp 8KB
Lj_Jihua_Detail.asp 8KB
LJ_SETFLASH.ASP 8KB
io.asp 8KB
Lj_Mailbox.asp 7KB
Lj_MyKaoqingSearch.asp 7KB
LJ_SYS.asp 7KB
UserManage.asp 7KB
User_select_left.asp 7KB
Lj_ShowFile.asp 7KB
LJ_KQ_DUTY.asp 7KB
Upfile_Photo.asp 7KB
x_wai_chuli.asp 7KB
c_company.asp 6KB
Upfile_Photo.asp 6KB
USelect_B.asp 6KB
word.asp 6KB
fckeditor.asp 6KB
Lj_KaoQing_M.asp 6KB
Lj_KaoQing_Overtimecontent.asp 6KB
Lj_Clock.asp 6KB
Lj_Hr_Xueli.asp 6KB
Option.asp 6KB
Lj_Hr_XueliEdit.asp 6KB
commands.asp 6KB
Lj_User_Act.asp 6KB
Lj_Hr_ZhengJian.asp 6KB
config.asp 6KB
Lj_KaoQing_Visa.asp 5KB
Select_right.asp 5KB
upfile_class.asp 5KB
UpFile_Class.asp 5KB
upfile_class.asp 5KB
Lj_Menu.asp 5KB
Reg.asp 5KB
Lj_Hr_ZhengJianEdit.asp 5KB
Message.asp 5KB
Profile.asp 5KB
Lj_KaoQing_content.asp 5KB
Service.asp 5KB
c_yewu.asp 4KB
Ajax.asp 4KB
LjFtext.asp 4KB
共 2080 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21
资源评论
毕业_设计
- 粉丝: 1935
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功