php forms php 05
DESCRIPTION
PHP course lecture 5 PHP Forms $_POST. $_GET.TRANSCRIPT
PHP Course5: PHP Forms
PHP Course [email protected]
Instructor Name: Mohamed Saad.
Email: [email protected]
Occupation: Web Developer In IT Big Dig.
PHP Course [email protected]
$_POST variable
• The predefined $_POST variable is used to collect
values from a form sent with method="post".
• The variables are not displayed in the URL.
Redirect.php
<!DOCTYPE html><html><body><form action="redirect.php" method="post">Username: <input type="text" name="username" autofocus><br>Password: <input type="password" name="password"><br><input type="submit"></form></body></html>
Copy Codeform.php
PHP Course [email protected]
Username: <?php echo $_POST["username"]; ?><br />Password: <?php echo $_POST["password"]; ?>
Copy Coderedirect.php
$_GET variable • Information sent from a form with the GET
method is visible to everyone (it will be
displayed in the browser's address bar) and has
limits on the amount of information to send.
• Note: The get method is not suitable for very
large variable values. It should not be used with
values exceeding 2000 characters.
Redirect.php
$_GET
$_GET
<!DOCTYPE html><html><body><form action="redirect.php" method=“get">Username: <input type="text" name="username" autofocus><br>Password: <input type="password" name="password"><br><input type="submit"></form></body></html>
Copy Codeform.php
PHP Course [email protected]
Username: <?php echo $_GET["username"]; ?><br />Password: <?php echo $_GET["password"]; ?>
Copy Coderedirect.php
Write Your own PHP function
We hope You enjoy This Tutorial.
For any Suggestions Please Email Us
PHP Course [email protected]
EndPOST & GET