Forum Moderators: coopster

Message Too Old, No Replies

External PHP/HTML Loader to a iframe from a server side php script

I have several questions to addrses here!

         

fshaw

5:11 am on Jun 25, 2007 (gmt 0)

10+ Year Member



I think I would call what i am trying to do is build a External PHP/HTML Loader where I am laoding a iframe on a web page from a server side PHP script - the action for trigering the event on making the iframe come visable i would like to be done in the server side script and because I do not want any user interaction on trigering that action or alert to happen.

Hiding the iframe

The only way to hide an iframe that allows both browsers to access its content is b setting the style property width and height to 0px for example like this:

<iframe name="myIframe" src="blank.html" style="width:0px;height:0px" frameborder="0">
</iframe>

In the example the scr="blank.html" would "blank.php" work also and does the file need to exist on the server of not will it throw a error condition? if so is there a better way to do that? i have also seen src=" " maybe that is a better solution - i just do not know? any comnets on that issue is welcome!

Unstead of load a page that contains a javascript alert. I want to trigger the alert by either one of two metords
first it could be done by passing something from a php server side script - but what can i do to acpompish that - I do not want to use the GET in the address bar due to the fact that i have a some security issues with that techique and feel
quite uncomfertable about the GET

Also there are differnces in the way the two browsers use the java script and the alert so by trigger the alert in the server side PHP avoids all that and i think as a lot cleaner for my use this time.

A thought might be the following - I could also use some type of techique to test the size of the text contained in the file named in the src= in the iframe properties but not clear at this point what i can do here either? Any ideas or sujestions about how that can be done.

I could also use both the server side PHP and the testing of the size of the file would be a shure way of makeing shure the ifrane stay hidden when nothing in the file named in the src= property.

The name property in the iframe which in the above example myframe is that the proper way to reference the iframe or should i also set the id= property and why would i have to please explain?

In the iframe construct or object above i want to have the scroll bar be active if the text being displayed in larger then the arae on the screen os the scroll bars set be default or do i have to explectly set the property handeling the scroll bars to get them to work?

Npw how should i handle the speed of loading a exteranl file in this case a PHP file into the iframe that is the file named in the
src= property.

what is the impact of just referenceing the php file containing the text that is to be loaded into the iframe directly. It is or coould be a lot of text.

Or is it the best policy to load the data in the background to a like hidden DIV or construct or some kind of blob variable or array of some kind something and then dump the text after it is local to the wab page then move it to the iframe? what are you thoughts on that also welcome.

does that all make sence above looking at all the issues? please explain and give examples when needed it would shure help.

THANKS

Frank H. Shaw

Note; An error of access denied or permission denied will be triggered if you try to access properties of the document loaded into the iframe or its window if that document is from another domain. In this case the document or text i am trying to load comes from the same domain so that will not be a problem!

omoutop

10:01 am on Jun 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



well to show/hide anything, you can use javascript.
just enclose the item in a <div></div>, setting style properties to dislplay:block.

if you search you will find thousants of scripts that hide/show text/images/tables.

Now, the external file can be brought to your server using the curl(). Do some reading about it here [gr2.php.net]