1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem With iFrame

Discussion in 'HTML & JavaScript' started by blackhataffiliate, Oct 23, 2009.

  1. blackhataffiliate

    blackhataffiliate Senior Member

    Joined:
    Oct 19, 2008
    Messages:
    847
    Likes Received:
    1,364
    Location:
    USA
    Set up a simple iFrame to forward a domain to another site. However when I type in framed domain - i get a blank page instead of the site I am forwarding to. Title is correct, all source code is correct and visible, but I get a blank page. Any ideas on what is causing this? If it matters, the framed domain and site I want forwarded to are being hosted on the same HostGator account. Here is the code I am using

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    
    <head>
      <title> Page Title</title>
      <meta name="keyword" content="keywords">
      <meta name="description" content="content">
    </head>
    <frameset rows="100%,*" border="0">
      <frame src="http://www.mydomain.com/" frameborder="0" />
      <frame frameborder="0" noresize />
    </frameset>
    
    <!-- pageok -->
    <!-- 01 -->
    <!-- 7.0-->
    </html>
    Can anyone help get this straight, because I cant see an error in the code or where an issue would be with the domain and/or hosting?
     
  2. origin

    origin Regular Member

    Joined:
    Nov 11, 2008
    Messages:
    334
    Likes Received:
    90
    Home Page:
    I don't think it's because of domain/hosting. But I see that your code is correct. Changed a bit:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>

    <head>
    <title> Page Title</title>
    <meta name="keyword" content="keywords">
    <meta name="description" content="content">
    </head>
    <frameset rows="100%,*" border="0">
    <frame src="http://www.mydomain.com/" frameborder="0" />
    <frame frameborder="0" noresize="noresize" />
    </frameset>

    <!-- pageok -->
    <!-- 01 -->
    <!-- 7.0-->
    </html>

    Not tested though.
     
  3. blackhataffiliate

    blackhataffiliate Senior Member

    Joined:
    Oct 19, 2008
    Messages:
    847
    Likes Received:
    1,364
    Location:
    USA
    Thanks for pointing out the coding problem and the correction. Made the correction, but still getting the blank page.
     
  4. cyklotrial

    cyklotrial Regular Member

    Joined:
    Oct 13, 2008
    Messages:
    248
    Likes Received:
    82
    Location:
    Wonderland
    Try this:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    
    <head>
      <title> Page Title</title>
      <meta name="keyword" content="keywords">
      <meta name="description" content="content">
    
    	<style type="text/css" media="screen">
    
    	body,html {
    
    	margin:0; padding:0 0 0
    
    	}
    
    
    
    	/* common styles */
    
    	iframe {
    
    	position: absolute;
    
      	top:0%;
    
    	left:0%;
    
    	width:100%;
    	height:100%;
    
    	} 
    
    
    
    
    
    	</style>
    
    </head>
    
    <body>
      <iframe src="http://www.mydomain.com/" frameborder="0"/>
    </body>
    <!-- pageok -->
    <!-- 01 -->
    <!-- 7.0-->
    </html>
     
  5. blackhataffiliate

    blackhataffiliate Senior Member

    Joined:
    Oct 19, 2008
    Messages:
    847
    Likes Received:
    1,364
    Location:
    USA

    Thanks for the code, I tried and I still get the same thing. I have asked the domain registrar (one of the last I have with GoDaddy) to see if maybe there is an issue and I cant get anyone with any common sense to respond. So... I am trying to figure it out on my own.
     
  6. cyklotrial

    cyklotrial Regular Member

    Joined:
    Oct 13, 2008
    Messages:
    248
    Likes Received:
    82
    Location:
    Wonderland
    last chance :)
    Try this:
    PHP:
    <?php
    header
    ('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
    ?>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>

    <head>
      <title> Page Title</title>
      <meta name="keyword" content="keywords">
      <meta name="description" content="content">

        <style type="text/css" media="screen">

        body,html {

        margin:0; padding:0 0 0

        }



        /* common styles */

        iframe {

        position: absolute;

          top:0%;

        left:0%;

        width:100%;
        height:100%;

        } 





        </style>

    </head>

    <body>
      <iframe src="http://www.mydomain.com/" frameborder="0"/>
    </body>
    <!-- pageok -->
    <!-- 01 -->
    <!-- 7.0-->
    </html>
    save it as php file :D

    or:

    load into iframe file with this code:
    PHP:
    <?php
    header
    ('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
    ?>
    <meta http-equiv="refresh" content="0;url=http://mydomain.com/" />
     
    Last edited: Oct 24, 2009
  7. blackhataffiliate

    blackhataffiliate Senior Member

    Joined:
    Oct 19, 2008
    Messages:
    847
    Likes Received:
    1,364
    Location:
    USA
    Thanks for all your help, I did get it working and it was a simple mistake that I was making.