soma56 Posted June 29, 2010 Share Posted June 29, 2010 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: 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 More sharing options...
ChemicalBliss Posted June 29, 2010 Share Posted June 29, 2010 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- Link to comment https://forums.phpfreaks.com/topic/206227-output-in-textbox-overlapping/#findComment-1078944 Share on other sites More sharing options...
soma56 Posted June 30, 2010 Author Share Posted June 30, 2010 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. Link to comment https://forums.phpfreaks.com/topic/206227-output-in-textbox-overlapping/#findComment-1078959 Share on other sites More sharing options...
ChemicalBliss Posted June 30, 2010 Share Posted June 30, 2010 <?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- Link to comment https://forums.phpfreaks.com/topic/206227-output-in-textbox-overlapping/#findComment-1078978 Share on other sites More sharing options...
soma56 Posted June 30, 2010 Author Share Posted June 30, 2010 Thanks guys, I appreciate it. Link to comment https://forums.phpfreaks.com/topic/206227-output-in-textbox-overlapping/#findComment-1079044 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.