Author |
Message |
Doulos
Life Cycles Becoming CPU Cycles

Joined: Jun 06, 2005
Posts: 732
|
Posted:
Sun Jun 08, 2008 2:45 pm |
|
Iframe block just quit working.
Quote: |
<?php
if (eregi("block-IFrame.php",$_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
}
$height = 482; // Edit height of iframe
$width = 704; // Edit width of iframe
//$iframescreen = "www.mysite.com/file.html"; // Enter site to be displayed in block...must be www.
$iframescreen = "http://clanfga.com/fgarulesbanner.html";
//Don't touch this part unless you know what you're doing
$content = "<center><iframe border=\"0\" src=\"http://$iframescreen\" width=\"$width\" height=\"$height\"></center></iframe>";
?>
|
I have verified that the files are present and I can call them individually with my browser. The block shows up but other than than the title there is no content. Any idea what happened? |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Sun Jun 08, 2008 3:06 pm |
|
Any changes to your .htaccess? |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
warren-the-ape
Worker


Joined: Nov 19, 2007
Posts: 196
Location: Netherlands
|
Posted:
Sun Jun 08, 2008 3:23 pm |
|
Bleehhh why do you use an ugly iframe? And why use it for an image?
Just use php in your block to get the contents of the page;
Code:$content = file_get_contents('http://www.website.com/page.php');
|
Edit:
In the iframe block code above switch; </center></iframe> </iframe></center>
You opened the <center> 1st so it should be closed last.
P.s. your site is visible in your code, not sure if that needs to be censored? |
|
|
|
 |
Doulos

|
Posted:
Sun Jun 08, 2008 10:48 pm |
|
Never mind, I do not know what the problem is, but the Iframe is working on IE and Firefox for other users. Just not me, for some reason.
Edit: Yep, I just restarted my computer and now it shows. Sorry. |
|
|
|
 |
warren-the-ape

|
Posted:
Mon Jun 09, 2008 1:17 am |
|
It wasn't showing for me last night either. But I see you switched the tags now so that might explain why its working again now
Its a really strange setup though, using an iframe to link to a html page with an image included as background.
Why not call the image from your block straight away? Or use the php i posted above. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Mon Jun 09, 2008 5:44 am |
|
Not sure of Doulos setup, but just wanted to briefly mention that many hosts do not allow remote file includes such as this. It is worth a try, though.  |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
evaders99
Former Moderator in Good Standing

Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Mon Jun 09, 2008 9:46 am |
|
Also if you are using remote file inclusions to other servers, you better be sure that site is loading 100%. If not, your script may hang on retrieving the data and your site will be really slow for your users.
I prefer iframes for static content that are loaded on the client side. |
_________________ - Only registered users can see links on this board! Get registered or login! -
Need help? Only registered users can see links on this board! Get registered or login! |
|
|
 |
Doulos

|
Posted:
Mon Jun 09, 2008 11:08 am |
|
The owner of the server is one of our members. He said he made no changes recently, and the block shows fine for some and not for others, and works fine all the time for me with Opera, but not with IE and Firefox. It also shows for me, in Firefox, the first time I load it after a restart, but then if I refresh the content disappears.
The file I am loading is not remote. I just don't know how to center a img inside a block the way warren suggested. I don't know php that well. I just hack (used in the worst way) through until I get it to do what I want. I will keep working at it, though.
Edit:
OK, so I got it to load an image this way... but it only shows up in Opera on my machine, not in IE or FF. I mean the block shows, but there is no content. Code:<?php
if (eregi("block-Rulesbanner.php",$_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
}
$content = "<center><img src='http://clanfga.com/fgarulesbanner.jpg' width='704' height='482' /></center>";
?>
|
|
|
|
|
 |
evaders99

|
Posted:
Mon Jun 09, 2008 12:12 pm |
|
Well I see the big banner on the top with IE and Firefox. Am I looking at the correct image? |
|
|
|
 |
warren-the-ape

|
Posted:
Mon Jun 09, 2008 12:21 pm |
|
Hmm you are mixing 2 things up here
Your single quotes should be double quotes and vice versa;
Code:<?php
if (eregi("block-Rulesbanner.php",$_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
}
$content = '<center><img src="http://clanfga.com/fgarulesbanner.jpg" width="704" height="482" /></center>';
?>
|
@ evaders99
Thnx for the tip, but i noticed the iframe link was coming from the same domain as his own site, hence my post
Offtopic;
Whats the difference between using; 'PHP_SELF' or 'SCRIPT_NAME' ? |
|
|
|
 |
Doulos

|
Posted:
Mon Jun 09, 2008 12:37 pm |
|
warren-the-ape wrote: | Hmm you are mixing 2 things up here
Your single quotes should be double quotes and vice versa; |
Thought I had tried it both ways. but I guess not. It is working now. At least to display an image, I still can't seem to get the IFrame to work again, though.
THANKS FOR THE HELP!!! |
|
|
|
 |
evaders99

|
Posted:
Mon Jun 09, 2008 2:31 pm |
|
Offtopic: SCRIPT_NAME can return the binary used as in a CGI environment - /cgi-bin/php rather than the PHP file itself. If you want the PHP file being executed, use PHP_SELF |
|
|
|
 |
|