Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
Doulos
Life Cycles Becoming CPU Cycles



Joined: Jun 06, 2005
Posts: 732

PostPosted: Sun Jun 08, 2008 2:45 pm Reply with quote

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 [ Only registered users can see links on this board! Get registered or login! ]
$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?
 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Sun Jun 08, 2008 3:06 pm Reply with quote

Any changes to your .htaccess?

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
warren-the-ape
Worker
Worker



Joined: Nov 19, 2007
Posts: 196
Location: Netherlands

PostPosted: Sun Jun 08, 2008 3:23 pm Reply with quote

Bleehhh why do you use an ugly iframe? And why use it for an image? Razz

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> Arrow </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?
 
View user's profile Send private message
Doulos







PostPosted: Sun Jun 08, 2008 10:48 pm Reply with quote

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







PostPosted: Mon Jun 09, 2008 1:17 am Reply with quote

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 Wink


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

PostPosted: Mon Jun 09, 2008 5:44 am Reply with quote

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. Wink

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Mon Jun 09, 2008 9:46 am Reply with quote

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.

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
Doulos







PostPosted: Mon Jun 09, 2008 11:08 am Reply with quote

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.Sad
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







PostPosted: Mon Jun 09, 2008 12:12 pm Reply with quote

Well I see the big banner on the top with IE and Firefox. Am I looking at the correct image?
 
warren-the-ape







PostPosted: Mon Jun 09, 2008 12:21 pm Reply with quote

Hmm you are mixing 2 things up here Wink

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 Smile

Offtopic;
Whats the difference between using; 'PHP_SELF' or 'SCRIPT_NAME' ?
 
Doulos







PostPosted: Mon Jun 09, 2008 12:37 pm Reply with quote

warren-the-ape wrote:
Hmm you are mixing 2 things up here Wink

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







PostPosted: Mon Jun 09, 2008 2:31 pm Reply with quote

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
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©