Jump to content

PHP Help W/ Textarea


itsureboy

Recommended Posts

Ok what im trying to do is similair to the example below:

HTML Page With A Form

[code]
<html>
<head><title>Test Page</title></head>
<body>
<h2>Data Collection</h2><p>
<form action="process.php" method="post">
<table>
<tr><td>Name:</td><td><input type="text" name="Name" /></td></tr>
<tr><td>Age:</td><td><input type="text" name="Age" /></td></tr>
<tr><td colspan="2" align="center"><input type="submit" /></td></tr>
</table>
</form>
</body>
</html>
[/code]

PHP Page With Function Which Proccesses Form Data:

[code]
<?php
print "Your name is ". $Name;
print "<br />";
print "You are ". $Age . " years old";
print "<br />";
$old = 25 + $Age;
print "In 25 years you will be " . $old . " years old";
?>
[/code]


However What i want to do is Instead of using input attribute use the textarea attribute to transfer html code to a file that contains a HTML body which will be used multiple times to Preview Layouts. My reason for this is so i dont have to make individual previews for each layouts.
Link to comment
Share on other sites

you dont need to do anything special. if you accept HTML in a textarea, then just picking it up from $_POST and echoing it is enough:

[code]
<?php
echo $_POST['mytextarea'];
?>

<form name="myform" action="" method="post">
<textarea name="mytextarea><img src="fdf"></textarea>
<input type="submit value="submit!" />
</form>
[/code]
Link to comment
Share on other sites

Guest
This topic is now 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.