I'm new at PHP so I made my first activity for practice and i can't determine the problem in my code.
<!DOCTYPE html>
<html>
<head><title>PHP activity</title></head>
<form action="act1.php" method="post">
Name: <input type="text" name="name"><input type="submit">
</form>
<?php
if ($_POST["name"] = " ") {
echo "Please Enter Your Name!";
}
else {
echo $_POST["name"];
}
?>
</html>
It does not give me my expected output. I was expecting that if the form is blank it must return "Please bla bla" , else , if it's not blank, it will return the input which is name.
But the output is always "Please bla bla"
I am really new to PHP