Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ***SOLVED***Embedded??? Dynamic Data

    Ok too much to explain so ill make this short, need to be able to pull dynamic data into a webpage that is already pulling all of its content from a database. I realize its badly designed but the record being pulled has actual HTML code within it. And that code needs to have another dynamic element within it.....


    So my first remedy was to use an IFrame to pull the data in.... which actually worked well.... until it came time to make a printer friendly of the page. The iframes print blank, which after researching i found out why. Since there are more then 1 iframes pulling data and since you must somehow focus to the iframe before its data will print, I am posed with a very serious delima... how do I get the data to display & print without causing me a major headache or having to entirely redo the handbook system.
    Last edited by CodeMage; 03-30-2006 at 03:44 PM.

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Use the XMLHTTP object to scrape the page(s) that you want to display. Then you don't need an IFrame.

  • #3
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That would work great if I could include ASP code into the actual record... but theres around 800 records with HTML code in each... and those need to pull names from another database... maybe I am approaching this at the wrong angle? However it is too late to do it differently the system is already built and running... I just need to somehow be able to pull data into a database record, then display and print it.

  • #4
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That did work great... I just had to take it a step further.... see below

    function StartPosition(data_str)

    Dim str_var
    str_var = data_str
    start_pos = InStr(str_var,"<!--url=")
    if (start_pos = 0) then
    StartPosition = FALSE
    else
    StartPosition = start_pos + 8
    end if

    end function

    function FinishPosition(data_str)

    Dim str_var
    str_var = data_str
    finish_pos = InStr(str_var,"||-->")
    if (finish_pos = 0) then
    FinishPosition = FALSE
    else
    FinishPosition = finish_pos
    end if

    end function

    function GetSourceUrl(start_var, finish_var, src_var)

    Dim st_var, f_var, s_var, url_var, len_var
    st_var = start_var
    f_var = finish_var
    s_var = src_var
    len_var = finish_var - start_var
    url_var = Mid(s_var,st_var,len_var)
    GetSourceUrl = url_var

    end function

    function ProcessInclude(url)

    Dim objxmlhttp, strscrape, strURL
    strURL = url
    Set objxmlhttp = Server.Createobject("Microsoft.xmlhttp")
    objxmlhttp.Open "GET", strURL, False
    objxmlhttp.Send
    strscrape = objxmlhttp.responseText
    Set objxmlhttp = Nothing
    response.Write(strscrape)

    end function

    function CheckSourceData(src)

    DIM start_var, finish_var, post_len
    DIM precode_str, postcode_str

    start_var = StartPosition(src)
    if (start_var < 1) then
    response.write(src)
    else
    finish_var = FinishPosition(src)
    precode_str = Left(src,start_var+1)
    post_len = Len(src) - finish_var - 4
    postcode_str = Right(src,post_len)
    url_var = GetSourceUrl(start_var,finish_var,src)
    response.write(precode_str)
    ProcessInclude(url_var)
    response.write(postcode_str)
    end if

    end function


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •