taking user input using php code example
Example 1: how to request user input in php
<?php
echo "What do you want to input? ";
$input = rtrim(fgets(STDIN));
echo "I got it:\n" . $input;
Example 2: sanitize user input php
<?php
function sanitize($string) {
return addslashes(htmlspecialchars($string));
}
?>