Jump to content

Remote XML values to PHP from form results?!


Kristoff1875

Recommended Posts

Sounds a bit long winded in the name so i'll explain...

 

I'm coding a site where the user inputs their vehicle reg, and submits the form. The site will then show their car's details. This is being done using an external service that provides an up to date database of vehicle details.

 

So far, i've got the form and when you submit it, it returns the vehicle data in an XML, but the XML it displays is remote. I need to retrieve the details back to the website to display on the page. Here is what I have already:

 

<html>
<head>
	<title>Reg Test Page</title>
</head>
<body>
	<form method="post" action="https://www.****.com/UAT/">
		<input type="hidden" name="ESERIES_FORM_ID" value="B2INT">
		<input type="hidden" name="MXIN_USERNAME" value="****"><br />
		<input type="hidden" name="MXIN_PASSWORD" value="****"><br/>
		REG<input type="text" name="MXIN_VRM" value="REG NUM"><br />
		<input type="hidden" name="MXIN_TRANSACTIONTYPE" value="03"><br />
		<input type="hidden" name="MXIN_PAYMENTCOLLECTIONTYPE" value="02"><br />
		<input type="hidden" name="MXIN_CAPCODE" value="1"><br />
		<input type="submit" />
	</form>
</body>
</html>

 

I've ***'d out some details for obvious reason. The form currently works fine and returns a valid XML response, but it's remote. My original plan was to get the form to load up in another php file that processes the detail and sends a file_get_contents() request, but looking at the results page on the xml, there is no extension to the posted url and if you go directly to it, you get the error "METHOD NOT ALLOWED. ONLY 'POST' IS ALLOWED."

 

The other issue I have is that i'm not sure how it's handling the request, and the url is not modified, so i'm not sure how i'd set an url with values to retrieve it?

 

Any help is gratefully received.

 

Cheers Guys.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.