Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 250 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PHP] User outputted text

#1
Hey everyone, here i a very simple html/php code which allows the user to print what ever text is entered.

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.
Reply

#2
Simple code... Its fine but I think you should change this part :
PHP Code:
<?php
$submit 
strip_tags($_POST['submit']);
$output strip_tags($_POST['output']);
if (
$submit) {
echo 
$output;
}
?>

TO :
PHP Code:
<?php
if(isset($_POST['submit']) && isset($_POST['output']))
{
    
$output strip_tags($_POST['output']);
    echo 
$output;
}
?>

No need of using another variable for $_POST['submit']....
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through