Jump to content

Output in textbox overlapping


soma56

Recommended Posts

Has anyone experienced this before?

 

I have an array that I've thrown into a loop to echo out contents. The contents are being echoed out over top each other. Here's a screen shot:

 

phpimage.jpg

 

I've tried placing my textarea code before the loop however it brings it outside the box. Because I have a large amount of 'echoing' being done through loops I have to place it in a box - otherwise it will spill down the page. Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/206227-output-in-textbox-overlapping/
Share on other sites

This look like a browser display issue.

 

Look at the Source Code (HTML) of the page.

I'm guessing you've got some overlapping DIVS (CSS Styled).

 

In any case, it won't be PHP creating display issues (except indirectly by creating the HTML/CSS Display output)

 

-cb-

Thanks, I appreciate it. I'm really lost when it comes to echoing my contents.

 

I can't figure out how to echo hundreds of lines of text into a simple textbox and no text box would create a very long page for the user. I'm going to keep digging around google but if anyone has any suggestions I'd appreciate it.  :(

<?php

// RANDOM TEXT GENERATOR - u can ignore this
$alphabet = "abcdefghijklmnopqrstuvwxyz";
$textmax = rand(2048,10240); // 2-10KB
$clength = 0;
$text = NULL;
while($clength < $textmax){
$wordsizemax = rand(1,10);
$cwlength = 0;
while($cwlength < $wordsizemax){
	if($clength+1 == $textmax){ $text.= "."; break; }
	$letter = rand(0,25);
	$text .= substr($alphabet, $letter, 1);
	$clength++;
	$cwlength++;
}
if($clength+1 == $textmax){ break; }
$text .= " ";
$clength++;
}

?>
This is all you need: 
<textarea name="test_textarea" cols="50" rows="6"><?php echo($text); ?></textarea>

 

That file on its own will work. (Tested)

 

This line:

<textarea name="test_textarea" cols="50" rows="6"><?php echo($text); ?></textarea>

 

Since you havn't provided code I cant help you any further.

 

-cb-

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.