Last active
August 29, 2015 14:09
-
-
Save msomu/48aa936a216c29e8173e to your computer and use it in GitHub Desktop.
This is a PHP simple file that sends data from html to php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title> | |
| This is an php tutorial | |
| </title> | |
| </head> | |
| <body> | |
| <form action="learnphp.php" method="post"> | |
| <table border="0"> | |
| <tr> | |
| <td>Name</td> | |
| <td align="center"><input type="text" name="username" size="30" /></td> | |
| </tr> | |
| <tr> | |
| <td>Address</td> | |
| <td align="center"><input type="text" name="streetaddress" size="30" /></td> | |
| </tr> | |
| <tr> | |
| <td>City</td> | |
| <td align="center"><input type="text" name="cityaddress" size="30" /></td> | |
| </tr> | |
| <tr> | |
| <td colspan="2" align="center"><input type="submit" value="Submit" /></td> | |
| </tr> | |
| </table> | |
| </form> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Information Gathered</title> | |
| </head> | |
| <body> | |
| <?php | |
| define('PI', 3.14); | |
| echo "The value of PI is" . PI; | |
| echo "</br> 5 + 2 =" . (5 + 2); | |
| echo "</br> 5 - 2 =" . (5 - 2); | |
| echo "</br> 5 * 2 =" . (5 * 2); | |
| echo "</br> 5 / 2 =" . (integer)(5 / 2); | |
| echo "</br> 5 % 2 =" . (5 % 2); | |
| $usersName=$_POST['username']; | |
| $streetAddress=$_POST['streetaddress']; | |
| $cityAddress=$_POST['cityaddress']; | |
| echo $usersName . "</br>"; | |
| echo $streetAddress . "</br>"; | |
| echo $cityAddress . "</br>"; | |
| $str = <<<EOD | |
| The coustomer name is $usersName and he lives in $streetAddress at $cityAddress </br> | |
| EOD; | |
| echo $str; | |
| ?> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment