This site uses cookies from Google to deliver its services, to personalize ads and to analyze traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies. Learn More

[Tech New] Php Form Example


Php Form Example
Since you'll need a place for the user to enter a search query, let's begin by building a form to handle the user's input. Every form must have these basic components:

The submission type defined with the method keyword

One or more input elements defined with the input tag

The destination to go to when submitted defined with the action keyword

A simple form with a text input field called search and a submit button.


<html>
<head>
<title>Test a Form</title>
</head>
<body>
<form action="<?php echo($_SERVER['PHP_SELF']); ?>"
method="get">
<label>
Search: <input type="text" name="search" />
</label>
<input type="submit" value="Add" />
</form>
</body>
</html>









Strictly speaking, forms are defined purely by HTML, but we're using some
PHP code on line 6 to reference the super global PHP_SELF. This provides a
shortcut to the name of the current PHP file that handles the submission
of the form data.

source : http://log.viva.co.id, http://tempo.co, http://seo-tips-tech.blogspot.com

0 Response to "[Tech New] Php Form Example"

Post a Comment

Contact

Name

Email *

Message *