Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help required POST form and receive XML response

Posted on 2010-09-20
10
Medium Priority
?
515 Views
Last Modified: 2012-05-10
Hi Experts,
I have very little experience with XML although I know a fair bit of php/mysql.

Background.
I am redesigning / redeveloping a site for an estate agent. The system they use will accept a search form with fields such as price, location, bedrooms etc from the web and instantly send back an XML response with a list of properties and their particulars.

My Problem.
Having so little experience with XML, once the form is submitted, how do I grab the resulting XML so I can manipulate it before it is displayed on the screen? I can see that the feed is working as when I post the form to the url I see on screen the resulting xml.

Ideally I would like to be able to grab the xml and import it into dreamweaver as a recordset or something similar.

I cant actually post the form & url as it contains the clients account data, but it just a standard html form that posts to a remote url.

Any ideas would be much appreciated.

Thanks in advance.
0
Comment
Question by:dovercomputers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 33720699
OK, if you can't post test data it will be hard to help you.  You might want to learn about SimpleXML functions. Start your reading here:
http://us2.php.net/manual/en/function.simplexml-load-string.php

And if you get some test data, please post it and I will show you how to access the properties.
0
 

Author Comment

by:dovercomputers
ID: 33720817
Thanks Ray.

I have put up a test form here http://holdingserver.co.uk/xmltest/xml.php

Once you submit the form it immediately displays an xml feed. I need to capture that feed before it displays so I can format it and make it pretty.

Thanks
Jim
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 33720997
I put some data into the form and clicked "search".  It gave me this.

Can you please post the PHP source code of the xml.php script?  It looks like you can process the XML it generated with SimpleXML.  So instead of echoing it to the browser output stream, we could use it in a script.
<?xml version="1.0" encoding="iso-8859-1" ?>
<!-- Aspasia XML public property search results -->
<!DOCTYPE aspasia_data SYSTEM "http://web.aspasia.net/pls/sandersn/aspasia_search.dtd">
<aspasia_data>
<company_info name="SPA Microsystems" software="Aspasia" website="www.aspasia.net" sales_phone="01344 750100" email="info@aspasia.net" address="5-6 Wellington Business Park, Dukes Ride, Crowthorne, Berkshire, RG45 6LS" version="2.37" />
<pagestart>1</pagestart>
<houses>
</houses>
<records>0</records>
<parameters>
	<de>RS</de>
	<be>0</be>

	<pf>125000</pf>
	<pt>175000</pt>
	<rf>MONTH</rf>
	<pc>
		<data></data>
		<data></data>
		<data></data>

		<data></data>
		<data></data>
		<data></data>
		<data></data>
	</pc>
	<pr>1</pr>
	<re>0</re>
	<ba>0</ba>

	<cl>N</cl>
	<qc>2</qc>
	<pp>10</pp>
	<pg>1</pg>
	<od>AP</od>
	<htm>N</htm>

</parameters>
</aspasia_data>

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:dovercomputers
ID: 33721080
Thanks. Its just a standard form. I have attached it here or you can just view the source from the web.


<form name="frm1" method="post" action="http://web.aspasia.net/pls/sandersn/aspasia_search.xml?">
<table border="1" cellpadding="0" cellspacing="3">
<tr row0>
<td>
Property Reference
</td><td>
<input type="text" name="pr" size=25 maxlength=250 title="You can put multiple ID's in seperated by commas, eg: 123,456,789">

</td>
<td>&nbsp;</td><td>&nbsp;</td>
<tr row1>
<td>
department
</td><td>
<select name="de" onChange="dissl(this.value)">
<option value="RS" selected>Residential Sales
<option value="RL">Residential Lettings
<option value="PHL">Holiday Lets
</select>
</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row2>
<td>
price from
</td><td>

<select name="pf" id="pfs" onChange="pfromchng(this, 'pfs', 'pts');" class=""><option value="2">£25,000<option value="50000">£50,000<option value="75000">£75,000<option value="100000">£100,000<option value="125000" selected>£125,000<option value="150000">£150,000<option value="175000">£175,000<option value="200000">£200,000<option value="225000">£225,000<option value="250000">£250,000<option value="275000">£275,000<option value="300000">£300,000<option value="325000">£325,000<option value="350000">£350,000<option value="375000">£375,000<option value="400000">£400,000<option value="450000">£450,000<option value="500000">£500,000<option value="600000">£600,000<option value="700000">£700,000<option value="800000">£800,000<option value="900000">£900,000</select>

</td>
<td>
price to
</td><td>
<select name="pt" id="pts" onChange="ptochng(this, 'pfs', 'pts');" class=""><option value="50000">£50,000<option value="75000">£75,000<option value="100000">£100,000<option value="125000">£125,000<option value="150000">£150,000<option value="175000" selected>£175,000<option value="200000">£200,000<option value="225000">£225,000<option value="250000">£250,000<option value="275000">£275,000<option value="300000">£300,000<option value="325000">£325,000<option value="350000">£350,000<option value="375000">£375,000<option value="400000">£400,000<option value="450000">£450,000<option value="500000">£500,000<option value="600000">£600,000<option value="700000">£700,000<option value="800000">£800,000<option value="900000">£900,000<option value="9999999999">£1,000,000+</select>

</td>
</tr><tr row3>
<td>
price from
</td><td>
<select name="pf" id="pfl" onChange="pfromchng(this, 'pfl', 'ptl');" class=""><option value="1">£250<option value="500">£500<option value="750">£750<option value="1000">£1000<option value="1250">£1250<option value="1500">£1500<option value="1750">£1750<option value="2000">£2000<option value="2500">£2500<option value="3000">£3000<option value="3500">£3500<option value="4000">£4000<option value="4500">£4500</select>

</td>
<td>
price to
</td><td>
<select name="pt" id="ptl" onChange="ptochng(this, 'pfl', 'ptl');" class=""><option value="500">£500<option value="750">£750<option value="1000">£1000<option value="1250">£1250<option value="1500">£1500<option value="1750">£1750<option value="2000">£2000<option value="2500">£2500<option value="3000">£3000<option value="3500">£3500<option value="4000">£4000<option value="4500">£4500<option value="999999999">£5000+</select>

</td>
</tr><tr row4>
<td>
minimum bedrooms
</td><td>
<select name="be" id="be" ><option value=0 selected>0<option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7+</select>
</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row5>

<td>
postcode prefix
</td><td>
<input name="pc" size="5" maxlength="6">
<br><input name="pc" size="5" maxlength="6">
<br><input name="pc" size="5" maxlength="6">
<br><input name="pc" size="5" maxlength="6">
<br><input name="pc" size="5" maxlength="6">
<br><input name="pc" size="5" maxlength="6">
<br><input name="pc" size="5" maxlength="6">
</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row5.5>
<td valign="top">
counties (regions)
</td><td colspan=3>
<table cellpadding=0 cellspacing=0 border=0 width="100%"><tr>

<td>Check&nbsp;all&nbsp;</td><td><input type="checkbox" name="cn" value="" onClick="chkAllcn()"></td></tr><tr>
</tr></table>
<script>
function chkAllcn(){
	var v_boxes = document.all.tags("INPUT");
	for (var c_box = 0; c_box < v_boxes.length; c_box++) {
		if (v_boxes[c_box].name == "cn") {
			if (!v_boxes[c_box].checked) {
				v_boxes[c_box].checked = true;
			} else {
				v_boxes[c_box].checked = false;
			}
		}
	}
}
</script>
</td>
</tr><tr row7>
<td valign="top">
towns
</td><td colspan=3>
<table cellpadding=0 cellspacing=0 border=0 width="100%"><tr><td align="right">Check&nbsp;all&nbsp;</td><td><input type="checkbox" name="tn" value="" onClick="chkAlltn()"></td></tr><tr><td align="right">Ashford&nbsp;</td><td><input type="checkbox" name="tn" value="1255"></td><td align="right">Canterbury&nbsp;</td><td><input type="checkbox" name="tn" value="1254"></td><td align="right">Maidstone&nbsp;</td><td><input type="checkbox" name="tn" value="1256"></td></tr></table><script>function chkAlltn(){	var v_boxes = document.all.tags("INPUT");	for (var c_box = 0; c_box < v_boxes.length; c_box++) {		if (v_boxes[c_box].name == "tn") {			if (!v_boxes[c_box].checked) {				v_boxes[c_box].checked = true;			} else {				v_boxes[c_box].checked = false;			}		}	}}</script>

</td>
</tr><tr row7>
<td valign="top">
locations
</td><td colspan=3>
<table cellpadding=0 cellspacing=0 border=0 width="100%"><tr><td align="right">Check&nbsp;all&nbsp;</td><td><input type="checkbox" name="lo" value="" onClick="chkAlllo()"></td></tr><tr><td align="right">Allington&nbsp;</td><td><input type="checkbox" name="lo" value="Allington"></td><td align="right">Ashford&nbsp;</td><td><input type="checkbox" name="lo" value="Ashford"></td><td align="right">Ashford Town Centre&nbsp;</td><td><input type="checkbox" name="lo" value="Ashford Town Centre"></td><td align="right">Aylesford&nbsp;</td><td><input type="checkbox" name="lo" value="Aylesford"></td></tr><tr><td align="right">Barming&nbsp;</td><td><input type="checkbox" name="lo" value="Barming"></td><td align="right">Bearsted&nbsp;</td><td><input type="checkbox" name="lo" value="Bearsted"></td><td align="right">Blean&nbsp;</td><td><input type="checkbox" name="lo" value="Blean"></td><td align="right">Bockhanger&nbsp;</td><td><input type="checkbox" name="lo" value="Bockhanger"></td></tr><tr><td align="right">Boughton Aluph&nbsp;</td><td><input type="checkbox" name="lo" value="Boughton Aluph"></td><td align="right">Boughton Lees&nbsp;</td><td><input type="checkbox" name="lo" value="Boughton Lees"></td><td align="right">Boughton Monchelsea&nbsp;</td><td><input type="checkbox" name="lo" value="Boughton Monchelsea"></td><td align="right">Brabourne&nbsp;</td><td><input type="checkbox" name="lo" value="Brabourne"></td></tr><tr><td align="right">Brabourne Lees&nbsp;</td><td><input type="checkbox" name="lo" value="Brabourne Lees"></td><td align="right">Bridge&nbsp;</td><td><input type="checkbox" name="lo" value="Bridge"></td><td align="right">Broadoak&nbsp;</td><td><input type="checkbox" name="lo" value="Broadoak"></td><td align="right">Bybrook&nbsp;</td><td><input type="checkbox" name="lo" value="Bybrook"></td></tr><tr><td align="right">Canterbury City Centre&nbsp;</td><td><input type="checkbox" name="lo" value="Canterbury City Centre"></td><td align="right">Chartham&nbsp;</td><td><input type="checkbox" name="lo" value="Chartham"></td><td align="right">Christchurch College&nbsp;</td><td><input type="checkbox" name="lo" value="Christchurch College"></td><td align="right">Coxheath&nbsp;</td><td><input type="checkbox" name="lo" value="Coxheath"></td></tr><tr><td align="right">Ditton&nbsp;</td><td><input type="checkbox" name="lo" value="Ditton"></td><td align="right">Downswood&nbsp;</td><td><input type="checkbox" name="lo" value="Downswood"></td><td align="right">East Malling&nbsp;</td><td><input type="checkbox" name="lo" value="East Malling"></td><td align="right">Faversham&nbsp;</td><td><input type="checkbox" name="lo" value="Faversham"></td></tr><tr><td align="right">Godmersham&nbsp;</td><td><input type="checkbox" name="lo" value="Godmersham"></td><td align="right">Gravesend&nbsp;</td><td><input type="checkbox" name="lo" value="Gravesend"></td><td align="right">Great Chart&nbsp;</td><td><input type="checkbox" name="lo" value="Great Chart"></td><td align="right">Grove green&nbsp;</td><td><input type="checkbox" name="lo" value="Grove green"></td></tr><tr><td align="right">Headcorn&nbsp;</td><td><input type="checkbox" name="lo" value="Headcorn"></td><td align="right">Herne Bay&nbsp;</td><td><input type="checkbox" name="lo" value="Herne Bay"></td><td align="right">Hinxhill&nbsp;</td><td><input type="checkbox" name="lo" value="Hinxhill"></td><td align="right">Hothfield&nbsp;</td><td><input type="checkbox" name="lo" value="Hothfield"></td></tr><tr><td align="right">Islington&nbsp;</td><td><input type="checkbox" name="lo" value="Islington"></td><td align="right">Kennington&nbsp;</td><td><input type="checkbox" name="lo" value="Kennington"></td><td align="right">Kings Hill&nbsp;</td><td><input type="checkbox" name="lo" value="Kings Hill"></td><td align="right">Kingsnorth&nbsp;</td><td><input type="checkbox" name="lo" value="Kingsnorth"></td></tr><tr><td align="right">Larkfield&nbsp;</td><td><input type="checkbox" name="lo" value="Larkfield"></td><td align="right">Lenham&nbsp;</td><td><input type="checkbox" name="lo" value="Lenham"></td><td align="right">Little Burton&nbsp;</td><td><input type="checkbox" name="lo" value="Little Burton"></td><td align="right">Littlebourne&nbsp;</td><td><input type="checkbox" name="lo" value="Littlebourne"></td></tr><tr><td align="right">London Rd Estate&nbsp;</td><td><input type="checkbox" name="lo" value="London Rd Estate"></td><td align="right">Loose&nbsp;</td><td><input type="checkbox" name="lo" value="Loose"></td><td align="right">Maidstone Town Centre&nbsp;</td><td><input type="checkbox" name="lo" value="Maidstone Town Centre"></td><td align="right">Marden&nbsp;</td><td><input type="checkbox" name="lo" value="Marden"></td></tr><tr><td align="right">Mersham&nbsp;</td><td><input type="checkbox" name="lo" value="Mersham"></td><td align="right">New Town&nbsp;</td><td><input type="checkbox" name="lo" value="New Town"></td><td align="right">Old Wives Lees&nbsp;</td><td><input type="checkbox" name="lo" value="Old Wives Lees"></td><td align="right">Orchard Heights&nbsp;</td><td><input type="checkbox" name="lo" value="Orchard Heights"></td></tr><tr><td align="right">Park Farm&nbsp;</td><td><input type="checkbox" name="lo" value="Park Farm"></td><td align="right">Penenden Heath&nbsp;</td><td><input type="checkbox" name="lo" value="Penenden Heath"></td><td align="right">Repton Park&nbsp;</td><td><input type="checkbox" name="lo" value="Repton Park"></td><td align="right">Rochester&nbsp;</td><td><input type="checkbox" name="lo" value="Rochester"></td></tr><tr><td align="right">Sellindge&nbsp;</td><td><input type="checkbox" name="lo" value="Sellindge"></td><td align="right">Sevington&nbsp;</td><td><input type="checkbox" name="lo" value="Sevington"></td><td align="right">Shadoxhurst&nbsp;</td><td><input type="checkbox" name="lo" value="Shadoxhurst"></td><td align="right">Singleton&nbsp;</td><td><input type="checkbox" name="lo" value="Singleton"></td></tr><tr><td align="right">Smeeth&nbsp;</td><td><input type="checkbox" name="lo" value="Smeeth"></td><td align="right">Snodland&nbsp;</td><td><input type="checkbox" name="lo" value="Snodland"></td><td align="right">South Ashford&nbsp;</td><td><input type="checkbox" name="lo" value="South Ashford"></td><td align="right">South Willesborough&nbsp;</td><td><input type="checkbox" name="lo" value="South Willesborough"></td></tr><tr><td align="right">St Dunstans&nbsp;</td><td><input type="checkbox" name="lo" value="St Dunstans"></td><td align="right">St Michaels&nbsp;</td><td><input type="checkbox" name="lo" value="St Michaels"></td><td align="right">Stanhope&nbsp;</td><td><input type="checkbox" name="lo" value="Stanhope"></td><td align="right">Staplehurst&nbsp;</td><td><input type="checkbox" name="lo" value="Staplehurst"></td></tr><tr><td align="right">Strood&nbsp;</td><td><input type="checkbox" name="lo" value="Strood"></td><td align="right">Sturry&nbsp;</td><td><input type="checkbox" name="lo" value="Sturry"></td><td align="right">Tenterden&nbsp;</td><td><input type="checkbox" name="lo" value="Tenterden"></td><td align="right">University of Kent&nbsp;</td><td><input type="checkbox" name="lo" value="University of Kent"></td></tr><tr><td align="right">Vinters Park&nbsp;</td><td><input type="checkbox" name="lo" value="Vinters Park"></td><td align="right">West Malling&nbsp;</td><td><input type="checkbox" name="lo" value="West Malling"></td><td align="right">Westgate-on-Sea&nbsp;</td><td><input type="checkbox" name="lo" value="Westgate-on-Sea"></td><td align="right">Westwell&nbsp;</td><td><input type="checkbox" name="lo" value="Westwell"></td></tr><tr><td align="right">Whitstable&nbsp;</td><td><input type="checkbox" name="lo" value="Whitstable"></td><td align="right">Willesborough&nbsp;</td><td><input type="checkbox" name="lo" value="Willesborough"></td><td align="right">Willesborough Lees&nbsp;</td><td><input type="checkbox" name="lo" value="Willesborough Lees"></td><td align="right">Wincheap&nbsp;</td><td><input type="checkbox" name="lo" value="Wincheap"></td></tr><tr><td align="right">Wye&nbsp;</td><td><input type="checkbox" name="lo" value="Wye"></td></tr></table><script>function chkAlllo(){	var v_boxes = document.all.tags("INPUT");	for (var c_box = 0; c_box < v_boxes.length; c_box++) {		if (v_boxes[c_box].name == "lo") {			if (!v_boxes[c_box].checked) {				v_boxes[c_box].checked = true;			} else {				v_boxes[c_box].checked = false;			}		}	}}</script>

</td>
</tr><tr row8>
<td>
minimum receptions
</td><td>
<select name="re" id="re" ><option value=0 selected>0<option value=1>1<option value=2>2<option value=3>3+</select>
</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row9>
<td>
minimum bathrooms
</td><td>
<select name="ba" id="ba" ><option value=0 selected>0<option value=1>1<option value=2>2<option value=3>3+</select>

</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row9.25>
<td valign="top">
branches
</td><td colspan=3>
<table cellpadding=0 cellspacing=0 border=0 width="100%"><tr><td align="right">Check&nbsp;all&nbsp;</td><td><input type="checkbox" name="br" value="" onClick="chkAllbr()"></td></tr><tr><td align="right">Canterbury Investments&nbsp;</td><td><input type="checkbox" name="br" value="CBSALE"></td><td align="right">Ashford Investments&nbsp;</td><td><input type="checkbox" name="br" value="ASHSALE"></td><td align="right">Maidstone Investments&nbsp;</td><td><input type="checkbox" name="br" value="MAIDSALE"></td><td align="right">Maidstone Lettings&nbsp;</td><td><input type="checkbox" name="br" value="HO"></td></tr><tr><td align="right">Canterbury Lettings&nbsp;</td><td><input type="checkbox" name="br" value="CANT"></td><td align="right">Canterbury Students&nbsp;</td><td><input type="checkbox" name="br" value="CTLS"></td><td align="right">Islington Lettings&nbsp;</td><td><input type="checkbox" name="br" value="ISL"></td><td align="right">Ashford Lettings&nbsp;</td><td><input type="checkbox" name="br" value="ASH"></td></tr><tr><td align="right">Head Office&nbsp;</td><td><input type="checkbox" name="br" value="SMT"></td></tr></table><script>function chkAllbr(){	var v_boxes = document.all.tags("INPUT");	for (var c_box = 0; c_box < v_boxes.length; c_box++) {		if (v_boxes[c_box].name == "br") {			if (!v_boxes[c_box].checked) {				v_boxes[c_box].checked = true;			} else {				v_boxes[c_box].checked = false;			}		}	}}</script>

</td>
</tr><tr row9.5>
<td valign="top">
contract status
</td><td colspan=3>
<table cellpadding=0 cellspacing=0 border=0><tr>
<td align="right">Check&nbsp;all&nbsp;</td><td><input type="checkbox" name="cs" value="" onClick="chkAllcs()"></td></tr><tr>
<td align="right">For Sale&nbsp;</td><td><input type="checkbox" name="cs" value="AVAI"></td>
<td align="right">Reactivated&nbsp;</td><td><input type="checkbox" name="cs" value="REACTIVATE"></td>
<td align="right">Under Offer&nbsp;</td><td><input type="checkbox" name="cs" value="UO"></td>
<td align="right">Valuation&nbsp;</td><td><input type="checkbox" name="cs" value="VALUE"></td>

</tr><tr>
<td align="right">Web Prospect&nbsp;</td><td><input type="checkbox" name="cs" value="WEBPROS"></td>
<td align="right">Withdrawn&nbsp;</td><td><input type="checkbox" name="cs" value="WITH"></td>
</tr></table>
<script>
function chkAllcs(){
	var v_boxes = document.all.tags("INPUT");
	for (var c_box = 0; c_box < v_boxes.length; c_box++) {
		if (v_boxes[c_box].name == "cs") {
			if (!v_boxes[c_box].checked) {
				v_boxes[c_box].checked = true;
			} else {
				v_boxes[c_box].checked = false;
			}
		}
	}
}
</script>

</td>
</tr><tr row10>
<td valign="top">
property ages
</td><td colspan=3>
<table cellpadding=0 cellspacing=0 border=0><tr>
<td align="right">Check&nbsp;all&nbsp;</td><td><input type="checkbox" name="ag" value="" onClick="chkAllag()"></td></tr><tr>

<td align="right">New&nbsp;</td><td><input type="checkbox" name="ag" value="NEW"></td>
<td align="right">Edwardian&nbsp;</td><td><input type="checkbox" name="ag" value="EDWA"></td>
<td align="right">Modern&nbsp;</td><td><input type="checkbox" name="ag" value="MOD"></td>
<td align="right">Victorian&nbsp;</td><td><input type="checkbox" name="ag" value="VICT"></td>
</tr><tr>
<td align="right">c. 1700's&nbsp;</td><td><input type="checkbox" name="ag" value="17CN"></td>
<td align="right">c. 1800's&nbsp;</td><td><input type="checkbox" name="ag" value="18CN"></td>
<td align="right">c. 1900's&nbsp;</td><td><input type="checkbox" name="ag" value="19CN"></td>
<td align="right">c. 2000's&nbsp;</td><td><input type="checkbox" name="ag" value="20CN"></td>

</tr><tr>
</tr></table>
<script>
function chkAllag(){
	var v_boxes = document.all.tags("INPUT");
	for (var c_box = 0; c_box < v_boxes.length; c_box++) {
		if (v_boxes[c_box].name == "ag") {
			if (!v_boxes[c_box].checked) {
				v_boxes[c_box].checked = true;
			} else {
				v_boxes[c_box].checked = false;
			}
		}
	}
}
</script>

</td>
</tr><tr row11>
<td valign="top">
property types
</td><td colspan=3>
<select name="ty" MULTIPLE size="6">
<option>
<option value="B1">B1
<option value="DETA">Detached
<option value="ENDT">End Terrace
<option value="FIRST">First Floor
<option value="GFLR">Ground Floor

<option value="LINK">Link Detached
<option value="SEC">Second Floor
<option value="SEMI">Semi Detached
<option value="MID">Terraced
<option value="TOP">Top Floor
</select>

</td>
</tr><tr row12>
<td valign="top">
property styles
</td><td colspan=3>
<table cellpadding=0 cellspacing=0 border=0><tr>
<td align="right">House&nbsp;</td><td><input type="checkbox" name="st" value="HOUS"></td>
<td align="right">Flat&nbsp;</td><td><input type="checkbox" name="st" value="FLAT"></td>

<td align="right">Bungalow&nbsp;</td><td><input type="checkbox" name="st" value="BUNG"></td>
<td align="right">Apartment&nbsp;</td><td><input type="checkbox" name="st" value="APART"></td>
</tr><tr>
<td align="right">Commercial Property&nbsp;</td><td><input type="checkbox" name="st" value="COMM"></td>
<td align="right">Cottage&nbsp;</td><td><input type="checkbox" name="st" value="COTT"></td>
<td align="right">Maisonette&nbsp;</td><td><input type="checkbox" name="st" value="MAIS"></td>
<td align="right">Starter Home&nbsp;</td><td><input type="checkbox" name="st" value="STARTHOME"></td>
</tr><tr>
<td align="right">Studio&nbsp;</td><td><input type="checkbox" name="st" value="STUD"></td>
<td align="right">Town House&nbsp;</td><td><input type="checkbox" name="st" value="TOWN"></td>

</tr></table>

</td>
</tr><tr row13>
<td valign="top">
property settings
</td><td colspan=3>
<select name="se">
<option>
<option value="CITY">City
<option value="VILL">Village
<option value="OUTS">Outskirts
<option value="RURA">Rural
<option value="SEMR">Semi-Rural
<option value="TOWN">Town
</select>

</td>
</tr><tr row13.5>
<td valign="top">
Tenure Types
</td><td colspan=3>
<select name="te" MULTIPLE size="4">
<option>
<option value="F">Freehold
<option value="L">Leasehold
<option value="N">Not Known
<option value="D">Feudal
<option value="S">Share of Freehold
<option value="V">Vendor to Confirm
</select>

</td>
</tr><tr row13.75>

<td valign="top">
Garden / Outside Space
</td><td>
<select name="ou">
<option value="">All
<option value="Y">Must Have Outside Space
<option value="N">No Outside Space
</select>
</td>
<td valign="top">
Quality Control
</td><td>
<select name="qc">
<option value="2">All
<option value="1">Must Have a description AND images
<option value="0">Does NOT Have a description OR any images
</select>

</td>
</tr><tr row14>
<td>
properties per page
</td><td>
<select name="pp" id="pp" ><option value=10 selected>10<option value=20>20<option value=30>30<option value=40>40<option value=50>50<option value=60>60<option value=70>70<option value=80>80<option value=90>90<option value=100>100</select>
</td>

<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row14a>
<td>
holiday lets available from (dd/mm/yyyy)
</td><td>
<input name="fa" size="12" maxlength="10">
</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row14b>
<td>
holiday lets available to (dd/mm/yyyy)
</td><td>
<input name="ta" size="12" maxlength="10">
</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row15>
<td>

page number
</td><td>
<select name="pg" id="pg" ><option value=1>1<option value=2>2<option value=3>3<option value=4>4<option value=5>5<option value=6>6<option value=7>7<option value=8>8<option value=9>9<option value=10>10<option value=11>11<option value=12>12<option value=13>13<option value=14>14<option value=15>15<option value=16>16<option value=17>17<option value=18>18<option value=19>19<option value=20>20<option value=21>21<option value=22>22<option value=23>23<option value=24>24<option value=25>25</select>

</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row16>
<td>
order by
</td><td>
<select name="od">
<option value="AP">ascending price<option value="DP">descending price<option value="T">town</select>
</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr><tr row17>
<td>
<input type="hidden" name = "upw" value="1467581F8E6F42D1BF0207B0A16964DE">
</td><td>

<input type="submit" value="search">
</td>
<td>&nbsp;</td><td>&nbsp;</td>
</tr>
</table>
</form>

Open in new window

0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 33721254
Uhh, I think what we need to see is the programming behind this URL:
http://web.aspasia.net/pls/sandersn/aspasia_search.xml

Any way you can simplify this into a test case?  It's kind of a lot of HTML to deal with - over 300 lines of code!
0
 

Author Comment

by:dovercomputers
ID: 33721295
My bad. Sorry.

In its basic form all that is required is one hidden field. This will return all results.


<form name="frm1" method="post" action="http://web.aspasia.net/pls/sandersn/aspasia_search.xml?">
<input type="hidden" name = "upw" value="1467581F8E6F42D1BF0207B0A16964DE">
<input type="submit" value="search">
</form>

Open in new window

0
 

Expert Comment

by:BillGeo
ID: 33721330
You will need a function to marshal the POST data, then make a URL request using the simplexml_load_file command:

// Function to send POST data to URL
function do_post_request($url, $data, $optional_headers = null, $method = 'POST')
{
    $params = array('http' => array('method' => $method, 'content' =>
        http_build_query($data)));
    if ($optional_headers !== null) // Add in any additional headers
    {
        $params['http']['header'] = $optional_headers;
    }

    // Makes it easier to add additional parameters such
    // as any optional HTTP headers as set above
    $context = stream_context_create($params);

    $fp = @fopen($url, 'rb', false, $context);

    if (!$fp)
    {
        return false;
    }
    $response = @stream_get_contents($fp);
    if ($response === false)
    {
        fclose($fp);
        return false;
    }
    fclose($fp);
    return $response;
}

//Code to get XML
define('TARGET_URL','http://www.targeturl.com.folder...');
$parameters = TARGET_URL.'?PARM1=xxx&PARM2=yyy&PARM3=zzz';
$xml = simplexml_load_file($parameters);
------------------------------------------------------
$xml can now be parsed as an object;

0
 

Expert Comment

by:BillGeo
ID: 33721397
Revision to the previous answer:  Sorry!

$parameters = array('PARM1' => 'parm1value', 'PARM2 => 'parm2value', ...);
$xml = simplexml_load_file(do_post_request(TARGET_URL, $parameters,""));

The previous answer applies to the GET method and does not need the do_post_request function.
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 33721532
Maybe I need to adjust my medication.  

The HTML form causes data to be aggregated and submitted to an "action script" which is identified by the URL in the "action=" attribute of the <form> tag.

It's the action script that creates and regurgitates the XML to the browser output stream.  I think we need to see / modify that script in order to get the XML into a string that we can interpret with SimpleXML functions.  Seeing the form is "nice" but it is the action script that is doing the "man behind the curtain" work, and that seems to be where we want to make a change.
0
 

Accepted Solution

by:
dovercomputers earned 0 total points
ID: 33721772
Thanks for all your input. I actually solved it myself using php curl.

So I could grab the xml into dreamweaver using spry, I submitted the form to my listing page, which then called a proxy page and using curl grabbed the xml result.

A bit of a workaround but it works fine with no appreciable slowdown.
listing.php
<?php
foreach ($_POST as $var => $value) {
if($var !="") {
$postvars .= $var."=".$value."&";
}
} 
$vardata = substr($postvars,0,-1); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="SpryAssets/xpath.js" type="text/javascript"></script>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var ds1 = new Spry.Data.XMLDataSet("proxy.php?<?php echo $vardata; ?>", "aspasia_data/houses/property", { subPaths: "address" });
//-->
</script>



proxy.php

$postvars ="";
$ch = curl_init();

$postvars .= "de=".$_GET['de'];
$postvars .= "&upw=".$_GET['upw'];
...
...

curl_setopt($ch, CURLOPT_URL,"http://web.aspasia.net/pls/sandersn/aspasia_search.xml?");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postvars);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$xml = curl_exec($ch);
curl_close ($ch);

header('Content-Type: text/xml');
echo $xml;

Open in new window

0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question