php forms php 05

11
PHP Course 5: PHP Forms PHP Course [email protected]

Upload: it-big-dig

Post on 13-Jun-2015

1.311 views

Category:

Education


8 download

DESCRIPTION

PHP course lecture 5 PHP Forms $_POST. $_GET.

TRANSCRIPT

Page 1: PHP Forms PHP 05

PHP Course5: PHP Forms

PHP Course [email protected]

Page 2: PHP Forms PHP 05

Instructor Name: Mohamed Saad.

Email: [email protected]

Occupation: Web Developer In IT Big Dig.

PHP Course [email protected]

Page 3: PHP Forms PHP 05

Contents• PHP Forms

o $_POST.

o $_GET.

PHP Course [email protected]

Page 4: PHP Forms PHP 05

$_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.

Page 5: PHP Forms PHP 05

Redirect.php

Page 6: PHP Forms PHP 05

<!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

Page 7: PHP Forms PHP 05

$_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.

Page 8: PHP Forms PHP 05

Redirect.php

$_GET

$_GET

Page 9: PHP Forms PHP 05

<!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

Page 10: PHP Forms PHP 05

Write Your own PHP function

Page 11: PHP Forms PHP 05

We hope You enjoy This Tutorial.

For any Suggestions Please Email Us

[email protected]

PHP Course [email protected]

EndPOST & GET