Home > PHP > PHP Form

PHP Form

PHP Form :

The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input.

HTML File : (FORM) (form.html) (To Get input)

<html>
<body>

<form action=”welcome.php” method=”post”>
Username: <input type=”text” name=”un” />
Password: <input type=”password” name=”pw” />
<input type=”submit” />
</form>

</body>
</html>

PHP File : (OUTPUT)(welcome.php)(To Print the result)

<html>
<body>

<?php echo $_POST[“un”]; ?><br />
<?php echo $_POST[“pw”]; ?>

</body>
</html>

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: