Slayer0248
Slayer0248

Reputation: 1261

text in an iframe with php

So I think I'm missing something on terms of iframes. If run this line of php code:

  echo"<iframe>sometext</iframe>";

The iframe shows up, but the text doesn't. Is there a way of doing this that works?

Upvotes: 0

Views: 1638

Answers (2)

Bernat
Bernat

Reputation: 1556

This is not a good practice, but when you set some content, you have to set the iframe width and height

<iframe src="somefile" width="99" height="99></iframe>

Upvotes: 0

octern
octern

Reputation: 4868

You don't put text between IFRAME tags. Instead, put the text you want in the page in a separate document, and use <iframe src="otherdocument.html"></iframe>.

If what you want is for some text to show up in a separate, scrollable frame, you could also use a DIV with the appropriate style settings (set an absolute or percentage height and width, and set overflow to scroll).

Upvotes: 2

Related Questions