A2xA Posted January 21, 2008 Share Posted January 21, 2008 Is there anyway I could open and iframe or a webpage in or as the background of a website? Thanks all help is appreciated and thanked Quote Link to comment https://forums.phpfreaks.com/topic/87134-solved-opening-an-iframe-inor-for-the-background-of-a-website/ Share on other sites More sharing options...
Nhoj Posted January 22, 2008 Share Posted January 22, 2008 Not sure anyone understands what you're trying to accomplish here... Can you elaborate or do you have any examples you can show us? Quote Link to comment https://forums.phpfreaks.com/topic/87134-solved-opening-an-iframe-inor-for-the-background-of-a-website/#findComment-445683 Share on other sites More sharing options...
resago Posted January 22, 2008 Share Posted January 22, 2008 yeah actually you can. load the webcode with something like: $capture=preg_replace('/.*<body>(.*)<\/body>.*/i', '$1', trim(file_get_contents ('http://www.whatever.com'))); then echo the contents of $capture to a div with a z-index lower than the rest of the site. I would also use an alpha filter/opacity of 50% Good luck, I like to see the end result. you could also use ajax to get the background. Quote Link to comment https://forums.phpfreaks.com/topic/87134-solved-opening-an-iframe-inor-for-the-background-of-a-website/#findComment-445761 Share on other sites More sharing options...
resago Posted January 22, 2008 Share Posted January 22, 2008 ajax only works if both pages are in the same domain. here a quick and dirty example: http://resago.com/test.php <html> <head> </head> <body> <div id="main" style="position: absolute; left: 0px; top: 0px; z-index=0;filter:alpha(Opacity=20)"> <?php print preg_replace('/.*<body>(.*)<\/body>.*/', '$1', trim(file_get_contents ('http://www.cnn.com'))); ?> </div> <div style="position: absolute; left: 0px; top: 0px; width=100%;height=100%; z-index=99;filter:alpha(Opacity=60)"> <center> Some stuff.<br> <h1>HAHA, we are on top of you!</h1> <br> blahblahblahblaowivfwiejfoweiuvhosdunvlidsunvldsinuvf<br> <h1>poop poop poop poop poop<br> HAHAHAHAHA<br> LALALALA<br> okokokok<br> <h1>poop poop poop poop poop<br> HAHAHAHAHA<br> LALALALA<br> okokokok<br> </h1> </center> <br><BR><BR><BR><BR><BR><BR><BR><br><BR><BR><BR><BR><BR><BR><BR> <br><BR><BR><BR><BR><BR><BR><BR><br><BR><BR><BR><BR><BR><BR><BR> <br><BR><BR><BR><BR><BR><BR><BR><br><BR><BR><BR><BR><BR><BR><BR> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/87134-solved-opening-an-iframe-inor-for-the-background-of-a-website/#findComment-445817 Share on other sites More sharing options...
resago Posted January 22, 2008 Share Posted January 22, 2008 Here is it using an iframe. I would use this method instead of php. <html> <head> </head> <body> <div id="background" style="position: absolute; left: 0px; top: 0px; z-index=1;filter:alpha(Opacity=30)"> <iframe src="http:\\www.cnn.com" height="768" width="1024" scrolling=no style="z-index=0"></iframe> </div> <div id="foreground" style="position: absolute; left: 0px; top: 0px; width=1024px; height=768px;z-index=99;filter:alpha(Opacity=60)"> <center> Some stuff.<br> <h1>HAHA, we are on top of you!</h1> <br> blahblahblahblaowivfwiejfoweiuvhosdunvlidsunvldsinuvf<br> <h1> HAHAHAHAHA<br> LALALALA<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> okokokok<br> </h1> </center> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/87134-solved-opening-an-iframe-inor-for-the-background-of-a-website/#findComment-446142 Share on other sites More sharing options...
resago Posted January 22, 2008 Share Posted January 22, 2008 mark as solved. twice. Quote Link to comment https://forums.phpfreaks.com/topic/87134-solved-opening-an-iframe-inor-for-the-background-of-a-website/#findComment-446178 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.