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 9 of 9
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    125
    Thanks
    30
    Thanked 0 Times in 0 Posts

    Site within a site???

    Hello. Here's my dilemma...

    I have a site hosted with no PHP/MySQL capabilities (let's call that www.siteA.com). Then I have another site hosted that does have PHP/MySQL capabilities (let's call that www.siteB.com). I'd like a way to masquerade it so that when a user goes to www.siteA.com, they actually are seeing and navigating through www.siteB.com. The URL in their address bar will not ever change from "www.siteA.com". I would build siteA's site pages in some directory on my siteB's server, and then just point it over to siteA somehow...

    Would an iframe do this? Or would that be obvious when you're in siteA that you're looking at another frame? I want this to be as seamless as possible. Also, I'd prefer to not to a re-direct, because I want siteA's URL to stay in the user's address bar. Please let me know if this is possible. Thanks!...

  • #2
    Regular Coder
    Join Date
    Nov 2004
    Location
    The land of chocolate
    Posts
    226
    Thanks
    1
    Thanked 16 Times in 16 Posts
    In your case an iframe would be your best solution, I think. You can make it look quite good.

    In the css of site A, set your body to have a margin of 0 px. Your iframe obviously needs a width and height of 100%, and a border-style set to none.

    Example:

    Code:
    <body style="margin:0px;">
    
    <iframe src="http://www.codingforums.com" width="100%" height="100%" style="border-style:none;"></iframe>
    
    </body>
    It looks quite seamless. Of course, when looking at the source you can see you are in fact on another page. Reloading the browser window also poses a problem: you are redirected to the original page in the iframe. If you go to another page in site B (the one loaded into the iframe) and you reload the browser, you are redirected to site B's homepage.

    But apart from that, I think it's the best option you have to achieve what you want.
    -Snow

    Susie, if you want to see your doll again, leave $100 in this envelope by the tree out front. Do NOT call the police. You CANNOT trace us. You CANNOT find us.

    Sincerely,
    - Calvin.

  • Users who have thanked snowieken for this post:

    ShootingBlanks (02-16-2009)

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Posts
    125
    Thanks
    30
    Thanked 0 Times in 0 Posts
    Awesome - that's exactly what I needed. Thanks! I kinda figured that the problems you mentioned would arise, but (as you said) it's my best option...

    Much appreciated for the code to get me started.

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Posts
    125
    Thanks
    30
    Thanked 0 Times in 0 Posts
    Wait a minute - I spoke too soon. I'm not sure that worked...

    Here's what happened. Here's the original site (Site B - with the PHP):

    http://www.shootingblanks.net/TEMP/stacymatt/index.php

    Here's the new site (Site A - with the iFrame):

    http://www.stacyandmatt.com/

    I only looked in Firefox and IE7, but both of them only have about an inch or two of the iframe displayed. Like, it's not stretching down the whole page to cover the entire site that the iFrame is in...

  • #5
    Regular Coder
    Join Date
    Nov 2004
    Location
    The land of chocolate
    Posts
    226
    Thanks
    1
    Thanked 16 Times in 16 Posts
    Sorry, my bad, in CSS you have to set the height of html and body as well in order for it to work.

    So, in the page with your iframe:
    Code:
    <html style="height:100%;">
    
    ...
    
    <body style="margin:0px;height:100%;">
    Can't test it at the moment, so see if that works!
    -Snow

    Susie, if you want to see your doll again, leave $100 in this envelope by the tree out front. Do NOT call the police. You CANNOT trace us. You CANNOT find us.

    Sincerely,
    - Calvin.

  • Users who have thanked snowieken for this post:

    ShootingBlanks (02-16-2009)

  • #6
    Regular Coder
    Join Date
    Sep 2007
    Posts
    125
    Thanks
    30
    Thanked 0 Times in 0 Posts
    Worked like a charm - thanks!!!

  • #7
    Regular Coder
    Join Date
    Nov 2004
    Location
    The land of chocolate
    Posts
    226
    Thanks
    1
    Thanked 16 Times in 16 Posts
    No worries!

    Heh, I'm gonna post solutions with errors everytime now if that gets me an extra thanks.
    -Snow

    Susie, if you want to see your doll again, leave $100 in this envelope by the tree out front. Do NOT call the police. You CANNOT trace us. You CANNOT find us.

    Sincerely,
    - Calvin.

  • #8
    Regular Coder
    Join Date
    Sep 2007
    Posts
    125
    Thanks
    30
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by snowieken View Post
    No worries!

    Heh, I'm gonna post solutions with errors everytime now if that gets me an extra thanks.
    Haha - I thought about that after I did my second "thanks". Oh well!

  • #9
    Regular Coder
    Join Date
    Nov 2004
    Location
    The land of chocolate
    Posts
    226
    Thanks
    1
    Thanked 16 Times in 16 Posts
    I posted quite some solutions on these forums already without ever getting a thanks for it (not even a reply), so as compensation for all of that I feel I'm entitled to this one.
    -Snow

    Susie, if you want to see your doll again, leave $100 in this envelope by the tree out front. Do NOT call the police. You CANNOT trace us. You CANNOT find us.

    Sincerely,
    - Calvin.


  •  

    Posting Permissions

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