Jump to content

php and iframe


9999

Recommended Posts

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
Share on other sites

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
Share on other sites

iframe is to my knowledge(which is not alot) used to load a page within a page so it would look something like this

IFRAME 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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.