You are here:  » Parsing two different URL's on the same page


Parsing two different URL's on the same page

Submitted by crounauer on Tue, 2006-02-21 12:40 in

Hi David,

Is it possible to parse two different URL's on the same page.

I have used the first parser to fill in information for use in a form. I would like to add more info below the form, but this requires a different URL!

Submitted by support on Tue, 2006-02-21 12:44

Hi,

Every call to MagicParser_parse() resets all internal variables so there shouldn't be a problem.

Remember that your record handler function does not need to be called "myRecordHandler"; so if you need 2 different handler functions just make sure that you use different names - for example:

<?php
  
require("MagicParser.php");
  function 
recordHandler1($record)
  {
    
// code to handle records from the first file
  
}
  
MagicParser_parse("file1.xml","recordHandler1");
  function 
recordHandler2($record)
  {
    
// code to handle records from the second file
  
}
  
MagicParser_parse("file2.xml","recordHandler2");
?>

Hope this helps!

Submitted by crounauer on Tue, 2006-02-21 12:46

Yes, that makes sense - Thanks again.