soma56 Posted June 15, 2010 Share Posted June 15, 2010 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 More sharing options...
B0b Posted June 15, 2010 Share Posted June 15, 2010 <textarea cols=20 rows=20><?php echo 'this' . "\n" . 'that' ?></textarea> Link to comment https://forums.phpfreaks.com/topic/204896-htmlcss-boxes-around-php-code/#findComment-1072677 Share on other sites More sharing options...
soma56 Posted June 16, 2010 Author Share Posted June 16, 2010 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? Link to comment https://forums.phpfreaks.com/topic/204896-htmlcss-boxes-around-php-code/#findComment-1072756 Share on other sites More sharing options...
kratsg Posted June 16, 2010 Share Posted June 16, 2010 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. Link to comment https://forums.phpfreaks.com/topic/204896-htmlcss-boxes-around-php-code/#findComment-1072757 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.