Forum Moderators: phranque
I have uploaded a search box where consumers can enter a car type and enter their zip code.
When the information is submitted, the other computer server replies with this response:
<?xml version="1.0"?>
- <response>
- <data-validation>
<data-validation-status>ok</data-validation-status>
</data-validation>
<dealer-available>true</dealer-available>
<lead-accepted>N/A</lead-accepted>
</response>
There are two possible <dealer-available> responses. TRUE OR FALSE.
What I want to do is have my website serve up one URL if the answer is "true" and another URL if the answer is "false". I was told this would be easy to do, but I can't figure out how to do it. If anyone can help, please post a reply. Thank you in advance.
[edited by: sugarkane at 9:33 am (utc) on July 31, 2003]
[edit reason] No URLs please [/edit]
This sounds like a commercial venture, possibly affiliate related, and some instructions are being provided to you. Perhaps if you paste the relavent parts into a post, we can help you decipher them.
Are you requesting data via a form at your site? At their site perhaps? How do you submit the data? It may give us a clue about how it is returned and how to handle it...
Is anyone familiar with this type thing? HALP!
When u parse this xml reply, you would get the xml structure into a multi dimensional array with its values and attributes. Then u can seelct the URL to redirect based on the value of this variable.
If you like to use just Client side, scripting, I think u can use VB to parse the XML and then display the corresponding URL.
This is not a pure XML programming but it is more related to Scripting.
Simply do a string search of the entire response for <dealer-available>, get the starting position (call it n), and read the next 4 characters from position n+18. They will either be "true" or "fals".
This would be easy to do client side (in Javascript) or server side in any scripting language.
Mark - as DaveAtIFG says, we'd need a bit more context in order to provide more help...