Hi Dominic

Just tried what you suggested, but its still the same?


This is the original php script, perhaps Coldfusion can't offer the same 
functionality as PHP, that's why there are problems implementing it in CF?


-----------

<?php

//arrays are hard coded, but these could be populated from a database

        $aUsers = array(
                "Ädams, Egbert",
                "Altman, Alisha",
                "Archibald, Janna",
        );
        
        
        $aInfo = array(
                "Bedfordshire",
                "Buckinghamshire",
                "Cambridgeshire",
                "Cheshire",
                "Cornwall",
                "Cumbria",
                "Derbyshire",
        );
        
        
        $input = strtolower( $_GET['input'] );
        $len = strlen($input);
        
        
        $aResults = array();
        
        if ($len)
        {
                for ($i=0;$i<count($aUsers);$i++)
                {
                        // had to use utf_decode, here
                        // not necessary if the results are coming from mysql
                        //
                        if (strtolower(substr(utf8_decode($aUsers[$i]),0,$len)) 
== $input)
                                $aResults[] = array( "id"=>($i+1) 
,"value"=>htmlspecialchars($aUsers[$i]), "info"=>htmlspecialchars($aInfo[$i]) );
                        
                        //if (stripos(utf8_decode($aUsers[$i]), $input) !== 
false)
                        //      $aResults[] = array( "id"=>($i+1) 
,"value"=>htmlspecialchars($aUsers[$i]), "info"=>htmlspecialchars($aInfo[$i]) );
                }
        }

        header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
        header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // 
always modified
        header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
        header ("Pragma: no-cache"); // HTTP/1.0

        {
                header("Content-Type: text/xml");

                echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?><results>";
                for ($i=0;$i<count($aResults);$i++)
                {
                        echo "<rs id=\"".$aResults[$i]['id']."\" 
info=\"".$aResults[$i]['info']."\">".$aResults[$i]['value']."</rs>";
                }
                echo "</results>";
        }
?>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312580
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to