Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Help with W3 Schools XML Tutorial

Options
  • 30-01-2008 2:00pm
    #1
    Registered Users 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

  • Moderators, Category Moderators, Motoring & Transport Moderators Posts: 21,238 CMod ✭✭✭✭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
    


  • Moderators, Category Moderators, Motoring & Transport Moderators Posts: 21,238 CMod ✭✭✭✭Eoin


    Can I assume this worked for you?


Advertisement