0

I have two pages one with the form submission and the other for the PHP code. I have a h1 heading written in the PHP file and works just fine. However when I add my if ($_POST['submit']){} statement the page doesn't display anything at all including the code that came before the statement? I have tried googling the issue but I was not able to find anything that seemed to relate. Here's my code: for the PHP page:

<!DOCTYPE html>
<html lang="en">
   <head>
    <meta charset="utf-8">
   </head>
   <body>
      <?php
      echo "<h1>This is php!</h1><br>"
      if($_POST['submit']){
          echo 'form submited!';
      }
      ?>

   </body>
</html>

Then my form from my html page:

<form id="signUpForm" action="AddAcount2.php" method="post">
    <input id="email" type="text" name="email" placeholder="Email"><br>
    <input id="uid" type="text" name="uid" placeholder="User Name"><br>
    <input id="password" type="text" name="password" placeholder="Password"><br>
    <button id="signUpFormButton" type="submit" name="submit">Sign Up!</button>
</form>
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
Dakota Miller
  • 493
  • 1
  • 4
  • 22

0 Answers0