PHP code within XML – Server side execution of code – Help

Discussion in 'PHP' started by phpfreek, Dec 1, 2009.

  1. #1
    Hi all,

    I am hosting an Ecommerce site and there are lots of users who use our XML files to get daily updates of the gadgets and devices.

    All the URLs are like
    http://www.example.com/test.xml

    I want to keep track of this xml files. When any xml file is called on internet, I want to update the view count of the items displayed in this xml file.

    In XML file, I can not put the PHP Code so I can not use it directly.

    Is there any thing on sever setting which may allow us to exec code when certain URL request comes?

    If so how can I do that any in which language I need to do coding?

    Is there any other way like .htaccess or anything else to achieve this? Also, I do not want redirect the XML URL.

    Any idea, help or suggestion will be great in this case since this will help me to keep track of each devices and how much popular it is?

    Thanks in advance.

    Maria
     
    phpfreek, Dec 1, 2009 IP
  2. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #2
    you could set xml to be parsed by the web server and convert the file to a php which outputs the xml file.
    search for "apache html parse as php" it will answer the first part.
    second part you would log the information you want to keep and send the content-type as XML and then send the file.
     
    shallowink, Dec 1, 2009 IP
  3. RaulG

    RaulG Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I can help you through this process 200U$S.



    Best regards,

    Raúl.
     
    RaulG, Dec 1, 2009 IP