06-11-2011, 04:58 PM
Hey everyone, here i a very simple html/php code which allows the user to print what ever text is entered.
Just save the file as test.php and run it, it is a very good code for beginners to use html and php together.
PHP Code:
<html>
<body>
<form action='test.php' method='POST'>
Text Area: </br><input type="text" size="65" rows="2"; maxlength="250" name="output"/>
<input type='submit' name='submit' value='Post'><br><br>
<?php
$submit = strip_tags($_POST['submit']);
$output = strip_tags($_POST['output']);
if ($submit) {
echo $output;
}
?>
</body>
</html>
Just save the file as test.php and run it, it is a very good code for beginners to use html and php together.