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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Arrow php site in iframe

    hi, i am relatively new to php so yah =]

    basically i want to display a php site with script and all in an iframe (or any solution)

    this is my code for the main site

    sites is roflwaffles.net (click on generator tab, then server 1)

    Code:
    <a href="http://imakethisfoofun.co.cc" target="iframe">Server 1</a>
    
    <iframe name="iframe" src ="#" width="718px" height="500px" frameborder="0" scrolling="yes">
      If you can read this your browser does not support iframes.
    </iframe>
    i dont think there is that cause it can redirect to other sites fine.

    when you try to click on the link, it redirects no to the box but the entire page changes.

    i've been trying to figure this out for days, help please

    thanks!

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    Are you going to give it a source to put into the <iframe>?
    src ="#"

    Also, and I'm not sure about this ... take out (remove) the px's in these:
    width="718px" height="500px"

  • Users who have thanked mlseim for this post:

    iwasalive (02-02-2010)

  • #3
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    not a php question.

    the site that your trying to view is busting out of the iframe?

    this is because of some javascript on the site to not allow this.

    Code:
    if (window.parent && window.parent.location != window.location)
    {
        window.parent.location = window.location;
    }

  • Users who have thanked angst for this post:

    iwasalive (02-02-2010)

  • #4
    Regular Coder
    Join Date
    May 2009
    Location
    Moore, OK
    Posts
    282
    Thanks
    11
    Thanked 41 Times in 41 Posts
    I would recommend against using frames at all in your site design, although many sites do it. If not all the proper javascripts are wrote when people google your site and find a page they may get that page without the parent frame (ie no navigation to get to the other pages.) I would instead recommend using php's include to include a header and footer file.

    Your header file - header.php
    PHP Code:
    <!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 profile="http://gmpg.org/xfn/11">
    <
    link rel="SHORTCUT ICON" href="images/favicon.ico" type="image/x-icon" />
    <
    meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <
    title>::. RoflWaffles Premium Link Generator .::</title>
    <
    script language=javascript>
    if (
    window.parent && window.parent.location != window.location)
    {
        
    window.parent.location window.location;
    }
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="keywords" content="file, generator, premium, Rapidshare, link, sharing" />
    <link rel="stylesheet" href="images/style.css" type="text/css" media="all">
    <link rel="stylesheet" href="images/print.css" type="text/css" media="print">
    <script type="text/javascript" src="images/dbx.js"></script>
    <script type="text/javascript" src="dbx-key.js"></script>
    <link rel="stylesheet" type="text/css" href="images/dbx.css" media="screen, projection"><!--[if lt IE 7]>
    <![endif]-->
    <link rel="images/stylesheet" type="text/css" media="screen" href="images/sociable.css"></head><body>
    <style type="text/css">
    .style1 {
        font-size:xx-small;
    }
    </style>
    </head><body>
    <div id="page">
      <div id="wrapper">
        <div id="header">
         <p align="center">
         <br><a><img src="images/header.png" alt="Roflwaffles premium link generator" align="center"></a>
        </div>
        <!-- /header -->
    <div id="nav">
    <ul style="width: 875px; height: 12px">
    <li class="page_item"><a href="index.html">Home</a></li>
    <li class="page_item"><a href="generator.php">Link Generator</a></li>
    <li class="page_item"><a href="contact.html">Contact Us</a></li>
    <li class="page_item"><a href="donate.html">Donate An Account</a></li>
    </ul>
          </div><!-- /nav -->


            
          <div id="content" style="width: 718px">

            <div class="post" id="post-1493">
          <div class="title">
              <h2>Select a Server</h2>

    <div id="nav2">
    <ul style="width: 875px; height: 12px">
    <li class="page_item"><a href="http://imakethisfoofun.co.cc" target="iframe">Server 1</a></li>
    <li class="page_item"><a href="servers/server2/index.php" target="iframe">Server 2</a></li>
    <li class="page_item"><a href="servers/server3/index.php" target="iframe">Server 3</a></li>
    <li class="page_item"><a href="servers/server4/index.php" target="iframe">Server 4</a></li>
    </ul>    




          </div> 
    your footer file - footer.php
    PHP Code:
            </div>
            <!-- /
    page nav -->

        
          </
    div><!--/content -->

        </
    div>
        <!--/
    left-col -->

        <!--/
    sidebar -->
        <
    hr class="hidden">

      </
    div><!--/wrapper -->

    <
    center>
    <!-- 
    START OF HIT COUNTER CODE -->
    <
    br><script language="JavaScript" src="http://www.counter160.com/js.js?img=6"></script><br><a href="http://www.***************"><img src="http://www.counter160.com/images/6/left.png" alt="Free web hosting" border="0" align="texttop"></a><a href="http://www.hosting24.com"><img alt="Web hosting" src="http://www.counter160.com/images/6/right.png" border="0" align="texttop"></a>
    <!-- END OF HIT COUNTER CODE -->
    </center>

    </div><!--/page -->

    </body></html> 
    Then on each of your frame pages use this...

    PHP Code:
    <?php
    include 'header.php';
    ?>
    This is where you would put you content from the iframe.
    <?php
    include 'footer.php';
    ?>
    Like I said it's definitely not necessary but will give you a better site in my opinion. Also when you direct someone to an anchor tag using the # at the end of a url it gets annoying if they didn't request it. Other than that the design isn't half bad although I'm completely clueless on the point of your sight.
    Last edited by Coyote6; 02-03-2010 at 05:04 AM.

  • Users who have thanked Coyote6 for this post:

    iwasalive (02-02-2010)

  • #5
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    3
    Thanked 0 Times in 0 Posts
    thanks for the response guys! =]

    Basically the site has many link generators.
    when i get too many users, (as i had before) the server crashese

    so what i want to do is place them on seperate servers but everyone can access through the main domain (using frames)

    or if there is a way to "mask" the address of the additional servers to show "www.roflwaffles.net" that would be even better

    this way, i dont want the visitors to bookmark specific servers but that they can only bookmark the main domain (roflwaffles.net)

  • #6
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by angst View Post
    not a php question.

    the site that your trying to view is busting out of the iframe?

    this is because of some javascript on the site to not allow this.

    Code:
    if (window.parent && window.parent.location != window.location)
    {
        window.parent.location = window.location;
    }

    thank you very much!!!i found the problem. i am new to javascript and php, i mostly learned HTML in my spare time so i dont know very much

    this javascript was preventing it =O

    THANK YOU GUYS@!!!!!!


  •  

    Posting Permissions

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