testing the database with usernamesearch
This commit is contained in:
@@ -9,33 +9,7 @@ body {
|
|||||||
|
|
||||||
<h2><font color="white">Send a message</h2>
|
<h2><font color="white">Send a message</h2>
|
||||||
|
|
||||||
<?php
|
<form method="post" action="messageSender.php">
|
||||||
$name = $message = "";
|
|
||||||
|
|
||||||
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
||||||
if (empty($_POST["name"])) {
|
|
||||||
$name = "";
|
|
||||||
} else {
|
|
||||||
$comment = test_input($_POST["name"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($_POST["Message"])) {
|
|
||||||
$message = "";
|
|
||||||
} else {
|
|
||||||
$message = test_input($_POST["message"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function test_input($data) {
|
|
||||||
$data = trim($data);
|
|
||||||
$data = stripslashes($data);
|
|
||||||
$data = htmlspecialchars($data);
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
|
|
||||||
Who are you sending it to?: <br><input type="text" name="name" value="<?php echo $name;?>">
|
Who are you sending it to?: <br><input type="text" name="name" value="<?php echo $name;?>">
|
||||||
<br><br>
|
<br><br>
|
||||||
Message: <br><textarea name="message" rows="5" cols="40"><?php echo $message;?></textarea>
|
Message: <br><textarea name="message" rows="5" cols="40"><?php echo $message;?></textarea>
|
||||||
|
|||||||
Reference in New Issue
Block a user