Jump to content

html/css boxes around php code


soma56

Recommended Posts

So, I have a css box that I styled around my results:

 

<html>
<head>
<title>My Cool Box</title>
<style>
div.customScroll {position:absolute; text-align:right; top:60px; overflow:auto;  margin-left:480px; width:350px; height:220px; border:2px lightblue solid!important; }

</style>
</head>
<body>

<?PHP 
echo "<div class=\"customScroll\">";

echo "this";
echo "<br />";
echo "that";
echo "</div>";

?>
</body>
</html>

 

My first question is, how do I grab the results? If this was a <textarea> I could simply add a "name" to it and grab the results...like this one:

 

<html>
<head>
<title>My Other Cool Box</title>

</head>
<body>


<?PHP 
echo "<textarea cols=\"20\" rows=\"5\" name=\"mybox\">";

echo "this";
echo "<br />";
echo "that";
echo "</textarea>";

?>
</body>
</html>

 

However the problem with this one is that the "<br />" tag is shown within the box and not recognized as an html tag?

Link to comment
https://forums.phpfreaks.com/topic/204896-htmlcss-boxes-around-php-code/
Share on other sites

Thanks, my problem with <textarea> is that I have a foreach that takes about 20 seconds to load. While it's loading the <textarea> box does not show at all. It only shows when php has finished doing it's thing. I tried placing the <textarea> code as the first thing after my <body> tag however this didn't change anything. Is this common?

So, it "doesn't" have to be a form element for you to grab results. In fact, something like this could work:

 

<input type="submit" onclick="window.location = 'http://www.somewebsite.com/somescript.php?variable='+escape(document.getElementById('yourDiv').value);" />

 

Which is merely JavaScript. It auto-redirects the page to a new page with the url and appends the escaped values (see urlencode) to the end of the URL.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.