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] Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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] Quote Link to comment 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] Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.