Welcome Guest, Not a member yet? Register   Sign In
Controller function not finding $_GET variable for jQuery Autocomplete
#8

[eluser]Fielder[/eluser]
Code:
<?php

        $q = strtolower($_GET['q']);
        if (!$q) return;
        $items = array(
        "Green Heron"=>"Butorides virescens",
        "Solitary Sandpiper"=>"Tringa solitaria",
        "Heuglin's Gull"=>"Larus heuglini"
        );
        
        foreach ($items as $key=>$value) {
            if (strpos(strtolower($key), $q) !== false) {
                echo "$key|$value\n";
            }
        }
?>
which is in search.php. Search.php is called by my jQuery Autocomplete. When the user begins typing in a text field, it runs the search.php file to display the matching text. I know strpos finds the first occurrence of the string, but the "$key|$value\n" ?? In action, it's only echoing the $key information.


Messages In This Thread
Controller function not finding $_GET variable for jQuery Autocomplete - by El Forum - 05-07-2009, 02:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB