I have a script which takes in html from the user as in full page html either from the user or grabs it via curl or from an email. The thing is that I have the html in a string but on the same page I need to show the htmnl in a separate iframe. I don't want to reput any database, curl or imap code in the page referenced by teh iframe at all - is there a way for me to show html passed into a url somehow? like as in a get variable .. the html can be huge here... sorry if it sounds weird.
(if i am not misunderstanding your question)
You could put the string in a textarea inside a form and submit the form ..
the receiving page would read the posted data and render it on the page..
I'm not quite sure what you want to do, put you could always post the string as a POST variable, no limitations on how long they can be.
You can encode pieces of HTML with urlencode
which is automatically decoded when you retrieve it with $_GET
or you can use e.g. base64_encode
and base64_decode
. The problem is that there are limits to $_GET
and $_POST
. Both can be set in your configuration settings, but sending large amounts of data via the URL is really not-done because that's not how it should be used.
But if I read your question correctly, you can fetch the HTML at the top of the page, and then load it into an iframe?
if ($_GET['url']) {
$html = file($_GET['url']);
}
if ($_POST['html']) {
$html = $_POST['html'];
}
And then include it:
<html>
..
<iframe ..><php echo $html; ?></iframe>
..
</html>
you can put the grabbed html into a temp file and put the link to that temp file into src="" of the iframe