0

I'm making a java applet for a project. I'm trying to get access to a database and receive information. I cannot and will not use jdbc for various reasons. So I'm trying to use xml parsing to receive information.

I'm xml parsing with DOM. I have php codes so I can get data from my mysql database.

This is my php codes: http://prntscr.com/p0hul

What the xml should look like:

<XML>
    <char>
        <id>
            1
        </id>
        <name>
            Bob
        </name>
    </char>
</XML>

What my Java code looks like: http://prntscr.com/p0igl

So right now I'm really confused. It looks like my java code is reading what the php code has, not the xml.

Can someone point me to the right direction? Thanks in advance

4
  • obviously its reading the php file, you have directly given the file to parser. PHP file should be on some server with its response type as text/xml. You can see how to execute php scripts here tuxradar.com/practicalphp/2/5/0 Commented Jan 13, 2013 at 6:56
  • It doesn't have to be on a server, but it has to be executed. And as @SuKu said, you're just reading the file, not executing it. Commented Jan 13, 2013 at 6:57
  • Thank you so much! I knew that it might be because the php is not executed, but didn't know what to do do from there. Commented Jan 13, 2013 at 7:09
  • Executing a php-file through java: stackoverflow.com/questions/655620/… Commented Jan 13, 2013 at 8:56

0

Your Answer

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