public
Description: A jQuery plugin that adds spellcheck support to inputs using the Google spell checker API.
Homepage: http://plugins.jquery.com/project/spellcheck
Clone URL: git://github.com/brandonaaron/jquery-spellcheck.git
Click here to lend your support to: jquery-spellcheck and make a donation at www.pledgie.com !
brandondrew (author)
Wed Jan 07 19:07:20 -0800 2009
brandonaaron (committer)
Wed Jan 07 19:39:55 -0800 2009
jquery-spellcheck / spellcheck.php
100644 21 lines (17 sloc) 0.683 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
header("Content-Type: text/xml; charset=utf-8");
$url="https://www.google.com/tbproxy/spell?lang=" . $_GET['lang'];
$text = urldecode($_GET['text']);
 
$body = '<?xml version="1.0" encoding="utf-8" ?>';
$body .= '<spellrequest textalreadyclipped="0" ignoredups="1" ignoredigits="' . $_GET['ignoredigits'] . '" ignoreallcaps="' . $_GET['ignorecaps'] . '">';
$body .= '<text>' . $text . '</text>';
$body .= '</spellrequest>';
 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);
curl_close ($ch);
 
print $contents;
?>