9999 Posted August 9, 2006 Share Posted August 9, 2006 If I have a php file:[code]<?php//60 or 70 lines of php code here?>[/code]How would I put this in an iframe?I tried the following which didn't work[code]<iframe src= <?php//60 or 70 lines of php code here?></iframe>[/code] Link to comment https://forums.phpfreaks.com/topic/16990-php-and-iframe/ Share on other sites More sharing options...
Jocka Posted August 9, 2006 Share Posted August 9, 2006 an iframe doesn't hold code, it opens up a seperate outside page. if your looking to put the PHP code in some kind of small, scrollable box, you should look into CSS. Link to comment https://forums.phpfreaks.com/topic/16990-php-and-iframe/#findComment-71622 Share on other sites More sharing options...
9999 Posted August 9, 2006 Author Share Posted August 9, 2006 Could I declare the entire php code block a function then put that function name in the src of the iframe Link to comment https://forums.phpfreaks.com/topic/16990-php-and-iframe/#findComment-71623 Share on other sites More sharing options...
Jocka Posted August 9, 2006 Share Posted August 9, 2006 No. Try using this code (borrowed from a quick google search)[code]<div style="width: 300px; height: 300px; overflow: auto; padding: 5px"> <?php //60 or 70 lines of php code here ?></div>[/code] Link to comment https://forums.phpfreaks.com/topic/16990-php-and-iframe/#findComment-71624 Share on other sites More sharing options...
angelb0y Posted August 9, 2006 Share Posted August 9, 2006 iframe is to my knowledge(which is not alot) used to load a page within a page so it would look something like thisIFRAME File[quote]<iframe src="The page you need to load.php></iframe>[/quote]PHP File[quote]<?php The lines of your code in this page ?>[/quote] Link to comment https://forums.phpfreaks.com/topic/16990-php-and-iframe/#findComment-71663 Share on other sites More sharing options...
9999 Posted August 9, 2006 Author Share Posted August 9, 2006 Thank you kindly Jocka.angelb0y: Yes, that is the function of the iframe. What I did was, I took "myphpfile.php" and put that code directly into my "index.php" page so I was not able to call it as I normally would. Link to comment https://forums.phpfreaks.com/topic/16990-php-and-iframe/#findComment-71911 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.