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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Help with W3 Schools XML Tutorial

  • 30-01-2008 1: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,263 ✭✭✭✭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,263 ✭✭✭✭Eoin


    Can I assume this worked for you?


Advertisement