When I do an
if ( empty($_POST['name']) ) {
$name = 'anon';
} else {
$name = $_POST['name'];
}
the name is always anon, even if someone enters characters in the field.
Also,
if ( empty($_POST['title']) ) {
} else {
$title = sha1( $_POST['title'] );
}
How can I make it so there is a ! inserted infront of ['title']?
1.) Are you really sure that your input field is named
name?I would also suggest to use
isset():2.) Use the concatenation operator (if you want to prepend all titles with a
!before hashing):