My proxy pass-through is passed a variable labeled “input”, this is variable passed from a javascript function that excepts the user input from a textbox. Currently this function isn’t terribly robust as it doesn’t check from non-letter characters, but is shown below:
Then the php file associates the value that was passed into the variable “$name_query” using the GET command. This variable is then used to load the XML file that is being parsed for our search request. Once the file has been loaded, the “foreach” loop searches through the requested XML file for the label “location” using a pointer command and assigns the results to a new variable named “$_location”. With each found result it then uses a pointer to get the locations child elements for the reviewlink, name, address and phone information while putting the results in a nicely formatted manner.
The loop continues through the results, stacking the result information nicely on the web page in it’s own empty DIV for the user to review. This is a rather simple and clean way to search and display results from an XML file using PHP and a loop. Below is the PHP code used:
http://people.emich.edu/jaltmann/beer2.html