Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Help with W3 Schools XML Tutorial

  • 30-01-2008 02:00PM
    #1
    Registered Users, Registered Users 2 Posts: 2,073 ✭✭✭


    Hi all,

    I'm trying to get a W3 Schools tutorial working on my pc but it's not working for me.

    Here's the tutorial: http://www.w3schools.com/xml/xml_savedata.asp

    I'm trying to get the "Real form example" to work.

    I've created a customer.htm file and a saveForm.asp file in the same directory.

    When I click submit on the html form I'm get a HTTP 500 - interal server error.

    Could someone have a quick look at the code in the tutorial and tell me what I'm doing wrong...thanks a mill.


Comments

  • Registered Users, Registered Users 2 Posts: 21,278 ✭✭✭✭Eoin


    A few things I did to get this working:

    1) On line 5:
    On Error Resume NextSet xmlDoc = server.CreateObject("Microsoft.XMLDOM")
    
    This should be 2 lines:
    On Error Resume Next
    Set xmlDoc = server.CreateObject("Microsoft.XMLDOM")
    

    2) Put a better error message in (last few lines) - the line in bold will print out the reason for the error.
    if err.number<>0 then
      response.write("Error: No information saved.")
      [B]Response.write err.description[/B]
    else
      response.write("Your information has been saved.")
    end if
    

    3) The reason I got was "access denied", so I changed the properties of the folder I was working in so the Internet User Guest account had write privileges, and it worked fine then.

    Edit - I also changed the script so the XML file is written to the same folder as the currently running script:
    line 33:
    xmlDoc.save Server.MapPath("Customer.xml") 'Release all object references
    


  • Registered Users, Registered Users 2 Posts: 21,278 ✭✭✭✭Eoin


    Can I assume this worked for you?


Advertisement