| | |
How to call css file for iframe?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2008
Posts: 293
Reputation:
Solved Threads: 11
I am calling some data from iframe.
i want to call my css for this frame ?
How to call css for iframe??
php Syntax (Toggle Plain Text)
<iframe id="pframe" width="'.$game['iframewidth'].'" height="'.($game['iframeheight'] + 20).'" src="'.$path.'" frameborder="0" scrolling="no" align="middle"></iframe>';
i want to call my css for this frame ?
How to call css for iframe??
Last edited by peter_budo; Mar 8th, 2009 at 6:50 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
the source for an iframe is a html file (xhtml php cgi asp etc)
you just put the css, or a call to the .css file in the <head> of the source file, the same as any other html file
you just put the css, or a call to the .css file in the <head> of the source file, the same as any other html file
Last edited by almostbob; Mar 2nd, 2009 at 11:21 am.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
here is what your opening html tag and head tags should look like.
PHP Syntax (Toggle Plain Text)
<html> <head> <title>YOUR TITLE HERE<title> <link rel=stylesheet type=text/css href=YOURCSSFILE.css> </head>
Last edited by jakx12; Mar 2nd, 2009 at 3:52 pm.
•
•
Join Date: Apr 2008
Posts: 293
Reputation:
Solved Threads: 11
I am asking about ...
is it possible to change the css of iframe...??
suppose i am on www.abc.com and my file is test.php
iframe is defined in test.php
$path="www.xyz.com/ddd?id=123"
that means in this iframe data of xyz.com ...
so is it possible to change css or design??
is it possible to change the css of iframe...??
suppose i am on www.abc.com and my file is test.php
iframe is defined in test.php
$path="www.xyz.com/ddd?id=123"
PHP Syntax (Toggle Plain Text)
<iframe id="pframe" width="'.$game['iframewidth'].'" height="'.($game['iframeheight'] + 20).'" src="'.$path.'" frameborder="0" scrolling="no" align="middle"></iframe>';
that means in this iframe data of xyz.com ...
so is it possible to change css or design??
no if it is from another site. Basically an iframe is a way of implementing html in a window inside the original window. What the iframe is acting as is basically like a browser window, except its implemented with in a html document. You cannot change the style or css of another site if the iframe is directly linked to that site. Just like you cannot change the style of daniweb inside your browser window.
Well since this is a PHP forum, i'll give you a PHP solution. You could pass the css file for the iframe to use in the url like so:
where style is the css file. In the iframe page, get this value from the $_GET superglobal and (after some error checking/security checks!!!) print the reference to this external stylesheet.
PHP Syntax (Toggle Plain Text)
<iframe id="pframe" width="'.$game['iframewidth'].'" height="'.($game['iframeheight'] + 20).'" src="'.$path.'?style='.$style.'" frameborder="0" scrolling="no" align="middle"></iframe>
Last edited by death_oclock; Mar 3rd, 2009 at 8:41 pm.
•
•
•
•
Well since this is a PHP forum, i'll give you a PHP solution. You could pass the css file for the iframe to use in the url like so:
where style is the css file. In the iframe page, get this value from the $_GET superglobal and (after some error checking/security checks!!!) print the reference to this external stylesheet.PHP Syntax (Toggle Plain Text)
<iframe id="pframe" width="'.$game['iframewidth'].'" height="'.($game['iframeheight'] + 20).'" src="'.$path.'?style='.$style.'" frameborder="0" scrolling="no" align="middle"></iframe>
This type of code may open you to a security problem , because you can direct this to a aribritary maclious CSS file.
Most often , there can be many possibilities for an XSS with other source complixities.
To quote myself for emphasis:
In the page inside the iframe, thoroughly check the css file requested. I would make sure it is one of a select number of specific filenames, rather than checking just the extension, etc.
•
•
•
•
Originally Posted by Death_oClock
(after some error checking/security checks!!!)
•
•
•
•
To quote myself for emphasis:
In the page inside the iframe, thoroughly check the css file requested. I would make sure it is one of a select number of specific filenames, rather than checking just the extension, etc.
I have clips now from one site working in another, like they belong, despite there being vastly different css.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
![]() |
Similar Threads
- pages (HTML and CSS)
- how to get 1 submit button to validate user's choice (ASP)
- iframe height (HTML and CSS)
- HELP with CSS/Javascript Drop down menu from Dynamic Drive (HTML and CSS)
Other Threads in the PHP Forum
- Previous Thread: Restarting Apps Using Php
- Next Thread: Sending file back to user
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array back beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parse parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql structure syntax system table thesishelp tutorial update upload url validation validator variable video web xml youtube






