Results 1 to 2 of 2

Thread: pass iframe src in link

  1. #1
    Join Date
    Oct 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default pass iframe src in link

    I am trying to pass the iframe src in a link.

    eg http://www.domain.com/framed_page.html?<iframe src=http://cnn.com/newsitem.html">

    So that it goes to page framed_page.html that contains an iframe, and the src parameter is derived from the link.

    This may be simple html, or needs a script. I also tried

    Link http://www.domain.com/framed_page.as.../newsitem.html

    Then in framed_page.asp

    <%
    Dim keyword
    varkeyword = Request.form("keyword")
    %>
    <iframe name="I1" src=<%= Request.QueryString("keyword") %> width="700" height="700">

    </iframe>


    Basically trying to dynamically build a page with using the same skeleton but different SRC.
    Any help appreciarted.

  2. #2
    Join Date
    Feb 2008
    Posts
    137
    Thanks
    18
    Thanked 2 Times in 2 Posts

    Default

    Ok try this;

    main.php => filename

    PHP Code:
    dirname="page/" 'change as needed
    mypath = "page/" '
    change as needed
    Set fso 
    CreateObject("Scripting.FileSystemObject"
    Set folder fso.GetFolder(server.mappath(dirname)) 
    Set filez folder.Files 
    FileCount 
    folder.Files.Count 
    response
    .write "<p>There are <b>" FileCount "</b>" " files</p>" 'change as needed

    For Each listing in filez 
    TotalChars = len(listing.name) 
    Title = left(listing.name,TotalChars - 4) 
    Title = replace(Title,"_"," ") 
    response.write "<a href='
    framed-page.asp?path=" & mypath 'change framed-page.asp?path as needed
    response.write listing.name 
    response.write "' class=""menu"" target=""_new"">" '
    change as needed
    response
    .write Title 
    response
    .write "</a><br>"  
    Next 
    framed-page.asp => filename
    PHP Code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!
    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml">
    <
    head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <
    title>Framer</title>
    </
    head>

    <
    body>
    <% 
    iframeSource request.querystring("path") %> 
    <
    iframe src="<%= iframeSource %>" border=3 frameborder=0 marginheight=0 marginwidth=0 width="100%" height="100%" name="iframeElement" id="iframeElement" scrolling=none></iframe>
    </
    body>
    </
    html
    Make a folder called page 'change as needed in main.asp then add some files, HTML if possible or whatever you want - ASP|PHP|Blah, Blah

    passme.asp => filename

    PHP Code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!
    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml">
    <
    head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <
    title>Pass me</title>
    </
    head>

    <
    body>
    <
    h1>Passed page</h1>
    <
    p>Hello I my path is ...</p>
    </
    body>
    </
    html
    What you want to do seems sneaky.
    This code in NO way supports your plans for whatever you want to do with it.
    Edit: If it's sneaky!

    Cheers
    Last edited by student101; 10-28-2008 at 05:47 PM.

Bookmarks

Posting Permissions

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