Results 1 to 12 of 12
Thread: PHP Forms and User Input
-
01-21-2012, 06:50 AM #1
MTV Regular
This user has no status.I am:----
- Join Date
- Dec 2011
- Posts
- 114
- MTV$
- 2
PHP Forms and User Input
The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input.
PHP Form Handling
The most important thing to notice when dealing with HTML forms and PHP is that any form element in an HTML page will automatically be available to your PHP scripts.
Example
The example below contains an HTML form with two input fields and a submit button:
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
When a user fills out the form above and click on the submit button, the form data is sent to a PHP file, called "welcome.php":
"welcome.php" looks like this:
<html>
<body>
Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.
</body>
</html>
Output could be something like this:
-
01-21-2012 06:50 AM # ADSAdvertise here Circuit advertisement
- Join Date
- My Birthday
- Posts
- Million and counting
-
02-04-2012, 07:24 AM #2
MTV Regular
This user has no status.I am:
- Join Date
- Feb 2012
- Location
- Nigeria
- Posts
- 281
- MTV$
- 481
Re: PHP Forms and User Input
what kind of web editor i can use in using that PHP Forms and User Input is wrote. i make use of notepad sometime
-
07-20-2012, 11:03 AM #3
MTV Regular
is just chillingI am:
- Join Date
- May 2012
- Location
- pasay city
- Posts
- 563
- MTV$
- -2
Re: PHP Forms and User Input
i am not familiar about this programming language you mentioned above,it is hard to do or should i say use,can i ask you if what sample of program you can do by using this kind of programming language?..
-
08-25-2012, 06:37 AM #4
Banned
This user has no status.I am:----
- Join Date
- Aug 2012
- Posts
- 463
- MTV$
- 1,116
Re: PHP Forms and User Input
Hello. I need some direction for the following problem (I am not sure where to begin my research): I essentially, using PHP and MySQL, allow a user to enter check boxes, text fields, and input fields and using them to build a form to retrieve some personal information about our user.
-
09-10-2012, 09:53 AM #5
Banned
is who wander are lost!!!I am:
- Join Date
- Sep 2012
- Posts
- 1,704
- MTV$
- 5,031
Re: PHP Forms and User Input
The example below contains an HTML form with two input fields and a submit button:
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
When a user fills out the form above and click on the submit button, the form data is sent to a PHP file, called "welcome.php":
"welcome.php" looks like this:
<html>
<body>
Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.
</body>
</html>
-
09-13-2012, 09:46 PM #6
Banned
This user has no status.I am:----
- Join Date
- Sep 2012
- Posts
- 1,129
- MTV$
- 3,336
Re: PHP Forms and User Input
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
When a user fills out the form above and click on the submit button, the form data is sent to a PHP file, called "welcome.php":
"welcome.php" looks like this:
<html>
<body>
Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old............
-
Re: PHP Forms and User Input
The most important thing to notice when dealing with HTML forms and PHP is that any form element in an HTML page will automatically be available to your PHP scripts.so its very easy with php .
-
Re: PHP Forms and User Input
Well this is very simple but yet very important part in PFP and this can be implemented in many fields in our career if we choose to become a professional web designer. So thanks for such an important post, Keep sharing more interesting facts on these topic.
-
09-28-2012, 05:48 PM #9
MTV Senior
is www.investorposts.comI am:----
- Join Date
- Jul 2012
- Posts
- 1,847
- MTV$
- 511
Re: PHP Forms and User Input
Really these is a great information and i really love to know it . I used to think that how we can have our data when we just submit button . What we have to do i used to wonder these like ,but now i came to know that PHP is used for it after we click submit button .
-
12-20-2012, 12:43 PM #10
MTV Newbie
This user has no status.I am:----
- Join Date
- Dec 2012
- Posts
- 7
- MTV$
- 21
Re: PHP Forms and User Input
<html>
<head>
<title>Adminloginpage</title>
<link rel="stylesheet" type="text/css" href="css/style1.css">
</head>
<body>
<div id="wrapper">
<div class="top">
<form name="login" action="admin/adminpage.php" method ="POST">
<table cellpadding= "5" cellspacing ="10">
<tr>
<th bgcolor="#999999" style="color:black">Username</th>
<th><input type="text" name="uname"></th>
</tr>
<tr>
<th bgcolor="#999999" style="color:black">Password</th>
<th><input type="text" name="password" ></th>
</tr>
<tr>
<td><input type="submit" name="submit" value ="SIGN IN"></td>
<a href="register.php">Register</a>
<td><a href="admin/forgotpassword.php">Forgot password</a></td></tr>
</table>
</form>
</div></div>
<?php
$a="";
if(isset($_GET['action']))
$a=$_GET['action'];
if($a=="failed")
{
echo "<div style='color:red;'>Username Invalid </div>";
}
?>
</body>
</html>
-
Re: PHP Forms and User Input
Very well explained but the truth is i'm new into web designing and i really didn't learn web design using codes i learned using design methos on dream weaver software, my question is how do 1 input PHP into HTML in web design especially in moving pictures
-
12-29-2012, 11:28 AM #12
MTV Regular
is back to MTVI am:
- Join Date
- Aug 2012
- Location
- kathmandu, nepal
- Posts
- 281
- MTV$
- 283
Re: PHP Forms and User Input
owo this is really good and very informative thread over here . this gonna make alots of sense being here in this forum . and this form tags over for this for php program and also for the web page developer . Thank you for making this tag over here in this forum . keep it up .
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)






























Reply With Quote



Bookmarks