0

Here is a simple form to send to admin_xml.php

<form name="review" action="admin_xml.php" method="post">
<textarea name="xml" cols="40" rows="10"></textarea>
<input class="submit" type="submit" value="Submit Request">
</form>

Here is the XML which I want to enter into the form to extract Data from MySQL Database.

<?xml version="1.0" encoding="UTF-8"?>
<GetOrdersIds>
    <Credentials>
        <Username>my_username</Username>
        <Password>my_password</Password>
    </Credentials>
    <Criterions>
        <OrderNumber></OrderNumber>
        <CustomerName></CustomerName>
        <StartDate></StartDate>
        <EndDate></EndDate>
        <OrderStatus></OrderStatus>
    </Criterions>
</GetOrdersIds>

What I want to achieve is when I enter the above XML data in the HTML form, it should go through my Database and match the tags in my database and extract that data and retrieve it back.

How to create a new request and add changes in admin_xml.php (parse XML request, check up, and then extract data from the database).

I would like to automate it, create certain fields which would be selectable. In this way, I can select which tags (data) from the database.

2
  • You actually want to enter XML by hand? Commented Jul 9, 2009 at 22:21
  • Not manually, i just gave an example. I would like to automate it, create certain fields which would be selectable. In this way, i can select which tags(data) from the database. Commented Jul 10, 2009 at 0:21

1 Answer 1

1

Everything you need is already baked into PHP:

  1. Use SimpleXML to process the XML file into something meaningful.

  2. Use the method described at php.net/mysql_list_fields to retrieve valid column names:

  3. Once you have validated the requested database fields, create your SQL query.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.