Friday, 6 September 2013

Is there a good way to populate an iframe using PHP?

Is there a good way to populate an iframe using PHP?

I have a variable, say $source in PHP that has a full HTML (e.g. <!DOCTYPE
html> <html><head><meta charset="utf-8">...). Is there a way I can create
an iframe and populate it with the $source variable using PHP? If not, is
there a smarter way to do this with a JavaScript+PHP combo?
PHP code...
$source = "&lt;!DOCTYPE html&gt; &lt;html&gt;&lt;head&gt;...";
echo '<iframe></iframe>'; // Show the content of the variable $source in
this iframe

No comments:

Post a Comment