ACTIVE SERVER PAGES & SQL SERVER

  • Hi,

    I have an ASP web based application with a SQL database. It allows a user to enter in an email message that will get sent out to a number of people.

    The problem I have is when the operator enters in a <TEXTAREA... a URL that contains a HTML special symbol!

    e.g. http://www.mywebsite.org?product=34&section=k

    The &sect is a special character, so when the <TEXTAREA... is populated from the database it gets converted on the screen, in the database it remains perfect until you save the record, then the special character is saved into the database !

    Does any one know how to prevent this from happening ?

    Cheers.

    Mike

  • There is a method called URLDecode in ASP that you can use to translate from the HTML.  I think it is a member of the server object.

    Aunt Kathi Data Platform MVP
    Author of Expert T-SQL Window Functions
    Simple-Talk Editor

  • Hi,

    I looked a little further into this and it appears that the SQL side is ok.

    It is simply the <TEXTAREA that converts HTML special symbols!

    In the URL I have &section=k

    &sect is a HTML special symbol !

    I need to get the text in the <TEXTAREA as it appears in the SQL table and not to convert some how !

    Thanks.

    MIKE

  • Look at methods URLEncode, URLDecode, HTMLEncode and HTMLDecode.  One of them should do what you need to do. 

    Aunt Kathi Data Platform MVP
    Author of Expert T-SQL Window Functions
    Simple-Talk Editor

  • Hi,

    The HTMLEncode worked fantastic !!!!!

    Thanks very much.

    Mike

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply