|
Posted by Satya on 02/28/07 05:52
On Feb 28, 12:02 am, Jeff North <jnort...@yahoo.com.au> wrote:
> On 27 Feb 2007 15:12:53 -0800, in comp.lang.javascript
> trp...@gmail.com
>
> <1172617973.224488.68...@k78g2000cwa.googlegroups.com> wrote:
> >| Ok, Here is the code for what I am doing, and the ajax library being
> >| used is SACK fromhttp://twilightuniverse.com/projects/sack/I just
> >| can't seem to pass more than about 6100 characters... Any ideas, or a
> >| better way to go?
>
> I recommend POSTing your form that way there is virtually no limit on
> the input size.
>
>
>
> >| <?php
> >|
> >| //If some search criteria was sent
> >| if(isset($_GET['searchCriteria']))
> >| {
> >|
> >| //////////////////////////////// DB
> >| Connection ///////////////////////////////////////////////////////
> >| //////////////////////////////////////////////////////////////////////////////////////////////////////
> >|
> >| include('./adodb/adodb.inc.php');
> >|
> >| //Type of connection
> >| $db = NewADOConnection('oci8');
> >|
> >| //Sets the query results to come back as assoc arrays
> >| $db->SetFetchMode(ADODB_FETCH_ASSOC);
> >|
> >| //Make the connection
> >| $db->PConnect('xxxxx', 'yyyyy', 'zzzzz');
> >|
> >|
> >|
> >| //////////////////////////////////////////////////////////////////////////////////////////////////////
> >|
> >| $rs = $db->Execute("SELECT DISTINCT ID, NAME FROM PEOPLE WHERE
> >| UPPER(NAME_DISPLAY) LIKE '".$_GET['searchCriteria']."%'");
> >|
> >| $results = null;
> >| while ($arr = $rs->FetchRow()) {
> >| echo "obj.options[obj.options.length] = new
> >| Option('".rawurlencode($arr["NAME"])."','".rawurlencode($arr["ID"])."');
> >| \n";
> >| }
> >|
> >| exit;
> >| }
> >|
> >| ?>
> >|
> >| <link href="style.css" rel="stylesheet" type="text/css" />
> >|
> >| <!-- AJAX for processing customer name search -->
> >| <script type="text/javascript" src="ajax.js"></script>
> >| <script type="text/javascript">
> >|
> >| var ajax = new sack();
> >|
> >| function searchInput(input)
> >| {
> >| //Set a variable to hold the value from the form input field
> >| var searchCriteria = input.value;
> >|
> >| //Empty results select box
> >| document.getElementById('result').options.length = 0;
> >|
> >| //If there is search criteria, then process
> >| if(searchCriteria.length>0)
> >| {
> >| //Pass to php to process
> >| ajax.requestFile = 'tst2.php?searchCriteria='+searchCriteria;
> >|
> >| //Specify function that will be executed to display results
> >| ajax.onCompletion = createResults;
> >|
> >| //Execute AJAX function
> >| ajax.runAJAX();
> >| }
> >| }
> >|
> >| function createResults()
> >| {
> >| var obj = document.getElementById('result');
> >|
> >| //Executing the response from Ajax as Javascript code
> >| //Sent from php as an escaped string so must escape
> >| alert(unescape(ajax.response));
> >| eval(unescape(ajax.response));
> >| }
> >|
> >| </script>
> >| <!-- END AJAX for processing customer name search -->
> >|
> >|
> >| <table>
> >| <tr>
> >| <td><b>Customer Name:</b></td>
> >| <td>
> >| <input class="cust" id="search" name="search" type="text"
> >| onchange="searchInput(this)">
> >| </td>
> >| </tr>
> >| <tr>
> >| <td> </td>
> >| <td><select multiple size="10" id="result" name="result">
> >|
> >| </select>
> >| </td>
> >| </tr>
> >| </table>
>
> ---------------------------------------------------------------
> jnort...@yourpantsyahoo.com.au : Remove your pants to reply
> ---------------------------------------------------------------
Yes do Post-ing with <?php ob_start('ob_gzhandler');?> in your PHP
file. This will compress your data.
[Back to original message]
|