I started with HTML yesterday and I'm trying to send some data from a page to another using PHP. I don't know if I am missing something but even the code I found on the Internet isn't working for me.
This is the code of my form:
<div class="login"> <form name="myForm" action="post.php" method="POST"> <div class="group1"> <input type="text" name="fusername"><span class="bar"></span> <label>Username</label> </div> <div class="group2"> <input type="text" name="fpassword"><span class="bar"></span> <span class="password"></span> <label>Password</label> </div> <button type="submit" class="button buttonBlue">Login</button> </form> </div> while this is the overall code of the post.php page:
<html> <body> Welcome <?php echo $_POST["fusername"]; ?><br> You inserted as a password: <?php echo $_POST["fpassword"]; ?> </body> </html> The only things I see after clicking the "Login" button are "Welcome" and "You inserted as a password".
I tried both get and post methods (with consistency) and I am still not able to see what I inserted in the forms.
I even tried to print a simple hello word, modifying the post.php page in this way:
<html> <body> <?php Echo "Hello, World!"; ?> </body> </html> but doing that I get a white page.
What am I actually missing or misunderstanding?
Many thanks.
POSTand you are using$_GET. Change it to$_POST.var_dump($_POST). Tell us what you get an error?<form> tag and try again:onsubmit="return validateForm()"