Ahmed Abbas Ahmed Abbas - 1 year ago 59
HTML Question

Text Box data not showing in PHP

In PHP, text is not showing when I type in textbox and click on submit.
Sorry for such a dumb question.

<form action="process.php" method="post">
Username: <input type="text" name="user" value=""/>
Password: <input type="text" name="pass" value=""/>
<input type="submit" name="submit" value="Submit"/>

Process.php is in external file


echo $password;
echo $username;

//echo $username." ".$password;

Answer Source

It works fine on my server by your code,so I suggest you troubleshoot as follows:

  1. see console whether has errors
  2. only write echo 'hello'; to see whether php engine works fine
  3. if page is jump and show noting after you click submit, check php error_log to see whether code has syntax or other error
  4. add var_dump($_POST); to dump all post data received