Location: PHPKode > scripts > SRETS (SimpleRETS) > srets-simplerets/SimpleRETS.php
<?php
/*//*********************************************************
SimpleRETS - Simplifing a complex MLS standard - by Ron T Goff
*************************************************************/

//Errors on while testing
error_reporting(E_WARNING);
ini_set('display_errors', 'On');

//Include the simpleRETS Base Package
include('SimpleRETS.Base.php');

//Configuration for specific MLS server
$SimpleRETS['Host']					= 'rets.retsserver.com';
//Port can be 6103 or 80
$SimpleRETS['Port']					= '6103';
//Version can be 1.0, 1.5 or 1.7
$SimpleRETS['Version'] 				= '1.5';
//Auth_Type can be Basic,Digest or Digest-QOP
$SimpleRETS['Auth_Type'] 			= 'Digest';
//Paths for certain areas of RETS server
$SimpleRETS['Get_Meta'] 		= '/Rets-Folder/getmetadata.aspx';
$SimpleRETS['Get_Object']		= '/Rets-Folder/getobject.aspx';
$SimpleRETS['Login'] 			= '/Rets-Folder/login.aspx';
$SimpleRETS['Search'] 			= '/Rets-Folder/search.aspx';
//User credentials
$SimpleRETS['Username'] 			= 'username';
$SimpleRETS['Password'] 			= 'password';
$SimpleRETS['User_Agent']		 	= 'Client/1.5';

//Query sent to RETS/MLS server
$SimpleRETS['Query'] = "Class=RESI&SearchType=Property&QueryType=DMQL2&Format=Standard-XML&Limit=100&Query=(SearchPrice=0-10000000),(Status=|A,P,S,W,C)";
//Get XML and place inside variable
$GetXML = SimpleRETS($SimpleRETS,'Search');

//Metadata query sample
//$SimpleRETS['Query'] = "Type=METADATA-TABLE&ID=0";
//Metadata call
//$GetXML = SimpleRETS($SimpleRETS,'Get_Meta');


//Locate start of XML Data
$Position = strpos($GetXML,'<?xml');
$GetXML = substr($GetXML,$Position);

//print results
$MLS_Data = simplexml_load_string($GetXML);
print_r($MLS_Data);

?> 
Return current item: SRETS (SimpleRETS)