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;
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;
sanitize form data php
# sanitize form data
function clean($data)
{
$data = htmlspecialchars($data);
$data = stripslashes($data);
$data = trim($data);
return $data;
}
php clean user input
<?php
function cleanUserInput($userinput) {
// Open your database connection
$dbConnection = databaseConnect();
// check if input is empty
if (empty($userinput)) {
return;
} else {
// Strip any html characters
$userinput = htmlspecialchars($userinput);
// Clean input using the database
$userinput = mysqli_real_escape_string($dbConnection, $userinput);
}
// Return a cleaned string
return $userinput;
}
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us