Insert HTML table structure in sql table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Soniad
    New Member
    • Jan 2009
    • 66

    Insert HTML table structure in sql table

    Hello,

    I want a complete table structure assign to a variable and then insert this table structure in one of column of sql table.
    the problem i am facing is vbscript is not interpreting html tags as string, how to escape this tags and make vbscript to detect as string .


    Regards,
    "D"
  • semomaniz
    Recognized Expert New Member
    • Oct 2007
    • 210

    #2
    Please post your code
    Last edited by semomaniz; Feb 4 '09, 03:40 PM. Reason: spelling

    Comment

    • jhardman
      Recognized Expert Specialist
      • Jan 2007
      • 3405

      #3
      Originally posted by semomaniz
      Please post your code
      agreed. As a general rule you could try to put the code within a <textarea></textarea>, then asp should be able to handle it fine, but without seeing your code there is no way to see if that would work for you.

      Jared

      Comment

      • Soniad
        New Member
        • Jan 2009
        • 66

        #4
        Insert HTML table structure in sql table

        Hello,

        Thanks for ur concern and reply , i got the solution , and working ,
        I put table structure in a variable , then in my sql insert query i replaced single quotes in that variable with double single quotes , the problem was sequel injection .

        here's the code :

        Code:
        								StrMsg=""
        								StrMsg=StrMsg&"<table border='0' width='90%' style='border: 1 solid #800000'>"
        								StrMsg=StrMsg&"<tr>"
        								StrMsg=StrMsg&"<td width='100%'><img border='0' src='http://www.microlifeline.net/images/registrationl.gif' width='750'  height='98'></td>"
        								StrMsg=StrMsg&"</tr>"
        								StrMsg=StrMsg&"<tr>"
        								StrMsg=StrMsg&"<td width='100%' ><P style='margin-left: 8'><font face='Verdana' size=2>"
        								StrMsg=StrMsg&" Hello "& strFirstName &",</font></td>"
        								StrMsg=StrMsg&"</tr>"
        								StrMsg=StrMsg&"<tr>"
        								StrMsg=StrMsg&" <td width='100%' ><P style='margin-left: 8'><font face='Verdana' size='2'>"&locateAdd
        								StrMsg=StrMsg&"</font></td> "
        								StrMsg=StrMsg&"</tr>"
        								StrMsg=StrMsg&"<tr>"
        								StrMsg=StrMsg&"<td width='100%'><P style='margin-left: 8'><font face='Verdana' size='2'>"
        								StrMsg=StrMsg&" MicroLifeLine Site Admin "
        								StrMsg=StrMsg&"</font></td>"
        								StrMsg=StrMsg&"</tr>"
        														
        								StrMsg=replace(StrMsg,"'","''")								
        
        								sqlemail = "insert  into Emails_To_Send (mailFrom,mailTo,mailCc,mailBcc,Subject,Message,dtdate,Mail_Sent,Attempts,mailPriority,App_ID,mailFormat)  values('admin@microlifeline.net','"&strEmailAddress&"','"&strEmailAddress&"','"&strEmailAddress&"','"&StrAction&"','"&StrMsg&"',getdate(),0,0,'normal',NULL,'html')"
        Regards,
        "D"

        Comment

        Working...