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
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?

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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