problem with displaying text in textarea

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chitrapu
Forum Newbie
Posts: 23
Joined: Sun Jan 14, 2007 11:39 pm

problem with displaying text in textarea

Post by chitrapu »

hiiiiiii
i have a textarea that displays some text. when i enter the text in 2 seperate lines and click a button, the text is getting displayed in a single line in another textarea, can u solve my problem please
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

compare your script with

Code: Select all

<html>
	<head><title>...</title></head>
	<body>
		<form method="post">
			<div>
				<textarea name="i1"></textarea>
				<br />
				<input type="submit" />
			</div>
		</form>
		last input:
		<br />
		<textarea readonly="readonly"><?php if (isset($_POST['i1'])) echo htmlentities($_POST['i1']); ?></textarea>
	</body>
</html>
Post Reply